Skip to content

Commit

Permalink
Merge pull request #215 from neicnordic/Security-fix/io.minio_upgrade
Browse files Browse the repository at this point in the history
upgrade io.minio dependency
  • Loading branch information
kusalananda authored Sep 11, 2023
2 parents 7a5aa10 + a5d399b commit f783aad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>7.1.4</version>
<version>8.5.5</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.uio.ifi.localega.doa;

import io.minio.MinioClient;
import io.minio.errors.*;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -63,12 +62,12 @@ public static void main(String[] args) {
*/
@Bean
public MinioClient archiveClient(@Value("${s3.endpoint}") String s3Endpoint,
@Value("${s3.port}") int s3Port,
@Value("${s3.access-key}") String s3AccessKey,
@Value("${s3.secret-key}") String s3SecretKey,
@Value("${s3.region}") String s3Region,
@Value("${s3.secure}") boolean s3Secure,
@Value("${s3.root-ca}") String s3RootCA) throws GeneralSecurityException, ServerException, InsufficientDataException, InternalException, IOException, InvalidResponseException, InvalidBucketNameException, XmlParserException, ErrorResponseException, RegionConflictException {
@Value("${s3.port}") int s3Port,
@Value("${s3.access-key}") String s3AccessKey,
@Value("${s3.secret-key}") String s3SecretKey,
@Value("${s3.region}") String s3Region,
@Value("${s3.secure}") boolean s3Secure,
@Value("${s3.root-ca}") String s3RootCA) throws GeneralSecurityException {
MinioClient.Builder builder = MinioClient.builder().endpoint(s3Endpoint, s3Port, s3Secure).region(s3Region).credentials(s3AccessKey, s3SecretKey);
Optional<OkHttpClient> optionalOkHttpClient = buildOkHttpClient(s3RootCA);
optionalOkHttpClient.ifPresent(builder::httpClient);
Expand All @@ -88,7 +87,7 @@ public MinioClient outboxClient(@Value("${s3.out.endpoint}") String s3Endpoint,
@Value("${s3.out.secret-key}") String s3SecretKey,
@Value("${s3.out.region}") String s3Region,
@Value("${s3.out.secure}") boolean s3Secure,
@Value("${s3.out.root-ca}") String s3RootCA) throws GeneralSecurityException, ServerException, InsufficientDataException, InternalException, IOException, InvalidResponseException, InvalidBucketNameException, XmlParserException, ErrorResponseException, RegionConflictException {
@Value("${s3.out.root-ca}") String s3RootCA) throws GeneralSecurityException {
MinioClient.Builder builder = MinioClient.builder().endpoint(s3Endpoint, s3Port, s3Secure).region(s3Region).credentials(s3AccessKey, s3SecretKey);
Optional<OkHttpClient> optionalOkHttpClient = buildOkHttpClient(s3RootCA);
optionalOkHttpClient.ifPresent(builder::httpClient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private InputStream getEncryptedResponse(byte[] header, InputStream bodyInputStr
return new SequenceInputStream(headerInputStream, bodyInputStream);
}

private InputStream getFileInputStream(LEGAFile file) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidResponseException, InternalException, InvalidBucketNameException, ErrorResponseException, ServerException, XmlParserException {
private InputStream getFileInputStream(LEGAFile file) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidResponseException, InternalException, ErrorResponseException, ServerException, XmlParserException {
String filePath = file.getFilePath();
try { // S3
BigInteger s3FileId = new BigInteger(filePath);
Expand Down

0 comments on commit f783aad

Please sign in to comment.