Skip to content

Commit

Permalink
Update AWS SDK v2 to 2.30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Jan 21, 2025
1 parent bcbc236 commit 1291793
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.auth.credentials.WebIdentityTokenFileCredentialsProvider;
import software.amazon.awssdk.core.checksums.RequestChecksumCalculation;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.http.SdkHttpClient;
import software.amazon.awssdk.http.apache.ApacheHttpClient;
Expand Down Expand Up @@ -52,6 +53,7 @@
import static java.lang.Math.toIntExact;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static software.amazon.awssdk.core.checksums.ResponseChecksumValidation.WHEN_REQUIRED;

final class S3FileSystemLoader
implements Function<Location, TrinoFileSystemFactory>
Expand Down Expand Up @@ -176,6 +178,8 @@ private static S3ClientFactory s3ClientFactory(SdkHttpClient httpClient, OpenTel
S3ClientBuilder s3 = S3Client.builder();
s3.overrideConfiguration(overrideConfiguration);
s3.httpClient(httpClient);
s3.responseChecksumValidation(WHEN_REQUIRED);
s3.requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED);

region.map(Region::of).ifPresent(s3::region);
endpoint.map(URI::create).ifPresent(s3::endpointOverride);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.checksums.RequestChecksumCalculation;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;

import java.io.IOException;
import java.net.URI;

import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static software.amazon.awssdk.core.checksums.ResponseChecksumValidation.WHEN_REQUIRED;

public class TestS3FileSystemMinIo
extends AbstractTestS3FileSystem
Expand Down Expand Up @@ -65,6 +67,8 @@ protected S3Client createS3Client()
.endpointOverride(URI.create(minio.getMinioAddress()))
.region(Region.of(Minio.MINIO_REGION))
.forcePathStyle(true)
.responseChecksumValidation(WHEN_REQUIRED)
.requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED)
.credentialsProvider(StaticCredentialsProvider.create(
AwsBasicCredentials.create(Minio.MINIO_ACCESS_KEY, Minio.MINIO_SECRET_KEY)))
.build();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.29.52</version>
<version>2.30.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Minio
{
private static final Logger log = Logger.get(Minio.class);

public static final String DEFAULT_IMAGE = "minio/minio:RELEASE.2024-12-18T13-15-44Z";
public static final String DEFAULT_IMAGE = "minio/minio:RELEASE.2025-01-20T14-49-07Z";
public static final String DEFAULT_HOST_NAME = "minio";

public static final int MINIO_API_PORT = 4566;
Expand Down

0 comments on commit 1291793

Please sign in to comment.