Skip to content

Commit fb60c3d

Browse files
committed
AWS: Disable local credentials if remote signing is enabled (#7230)
1 parent ffe8756 commit fb60c3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.apache.iceberg.util.SerializableMap;
4040
import org.slf4j.Logger;
4141
import org.slf4j.LoggerFactory;
42+
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
4243
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
4344
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
4445
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
@@ -1126,7 +1127,9 @@ public Map<String, String> httpClientProperties() {
11261127
*/
11271128
public <T extends S3ClientBuilder> void applyS3CredentialConfigurations(T builder) {
11281129
builder.credentialsProvider(
1129-
credentialsProvider(s3AccessKeyId, s3SecretAccessKey, s3SessionToken));
1130+
s3RemoteSigningEnabled
1131+
? AnonymousCredentialsProvider.create()
1132+
: credentialsProvider(s3AccessKeyId, s3SecretAccessKey, s3SessionToken));
11301133
}
11311134

11321135
/**

0 commit comments

Comments
 (0)