You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by dw...@apache.org on 2023/04/04 17:37:53 UTC
[iceberg] 03/06: AWS: Disable local credentials if remote signing is enabled (#7230)
This is an automated email from the ASF dual-hosted git repository.
dweeks pushed a commit to branch 1.2.x
in repository https://gitbox.apache.org/repos/asf/iceberg.git
commit fb60c3d4ffdfaa9c152e760a063db717b6c5a4ce
Author: Daniel Weeks <dw...@apache.org>
AuthorDate: Mon Apr 3 12:06:36 2023 -0700
AWS: Disable local credentials if remote signing is enabled (#7230)
---
aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java b/aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
index 94bc7e6ceb..b1ab6c0d5d 100644
--- a/aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
+++ b/aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
@@ -39,6 +39,7 @@ import org.apache.iceberg.util.PropertyUtil;
import org.apache.iceberg.util.SerializableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
@@ -1126,7 +1127,9 @@ public class AwsProperties implements Serializable {
*/
public <T extends S3ClientBuilder> void applyS3CredentialConfigurations(T builder) {
builder.credentialsProvider(
- credentialsProvider(s3AccessKeyId, s3SecretAccessKey, s3SessionToken));
+ s3RemoteSigningEnabled
+ ? AnonymousCredentialsProvider.create()
+ : credentialsProvider(s3AccessKeyId, s3SecretAccessKey, s3SessionToken));
}
/**