Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public static S3Fs build(S3Configuration cfg) {
final URI uri;
String region = resolved.region() != null && !resolved.region().isBlank() ? resolved.region() : DEFAULT_AWS_REGION;
System.setProperty(AWS_REGION_KEY, region);
System.setProperty("aws.accessKeyId", cfg.getAccessKeyId());
System.setProperty("aws.secretAccessKey", cfg.getSecretAccessKey());
// AWS SDK for Java 2.30.0+ defaults to attaching a flexible checksum (e.g. a CRC32
// trailer) to every PutObject and validating one on every GetObject. Many
// third-party S3-compatible stores (Ceph RGW included) don't handle that request
Expand All @@ -64,10 +62,14 @@ public static S3Fs build(S3Configuration cfg) {
System.setProperty("s3.spi.force-path-style", "true");
}
PROVIDER = new S3XFileSystemProvider();
// Credentials go through the URI userInfo instead of the global
// aws.accessKeyId/aws.secretAccessKey properties - see PR #83.
String userInfo = buildUserInfo(cfg);
uri = new URI("s3x", userInfo, url.getHost(), url.getPort(), "/" + cfg.getBucketName(), null, null);
} else {
// AWS S3 – the provider uses the default region/credentials chain
// AWS S3: no URI-embedded credentials, so these are the only way to set them.
System.setProperty("aws.accessKeyId", cfg.getAccessKeyId());
System.setProperty("aws.secretAccessKey", cfg.getSecretAccessKey());
PROVIDER = new S3FileSystemProvider();

uri = new URI("s3","/" + cfg.getBucketName(), null, null);
Expand Down