iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

AWS: AssumeRoleAwsClientFactory.s3() skips S3 access grants and user agent config

Open thswlsqls opened this issue 4 months ago • 1 comments

Apache Iceberg version

main @ 5f3d3c560

Query engine

None (AWS module, engine-agnostic)

Please describe the bug

AssumeRoleAwsClientFactory.s3() does not apply the S3 Access Grants plugin or the s3fileio/ user agent prefix, so S3 clients built through the assume-role factory ignore s3.access-grants.enabled and never set the S3 FileIO user agent, even when configured.

The sibling DefaultAwsClientFactory.s3() (aws/src/main/java/org/apache/iceberg/aws/AwsClientFactories.java line 108) applies both between the signer and retry configurations:

.applyMutation(s3FileIOProperties::applySignerConfiguration)
.applyMutation(s3FileIOProperties::applyS3AccessGrantsConfigurations)
.applyMutation(s3FileIOProperties::applyUserAgentConfigurations)
.applyMutation(s3FileIOProperties::applyRetryConfigurations)

AssumeRoleAwsClientFactory.s3() (aws/src/main/java/org/apache/iceberg/aws/AssumeRoleAwsClientFactory.java line 42) has the signer and retry lines but not the two in the middle.

Steps to reproduce

Configure a table with client.factory=org.apache.iceberg.aws.AssumeRoleAwsClientFactory and s3.access-grants.enabled=true. The S3 client built by s3() has no access grants plugin and no user agent prefix. Expected: same S3 configuration as the default factory.

Additional context

N/A

thswlsqls avatar Jul 16 '26 09:07 thswlsqls

#17246 by @thswlsqls was moved to draft in July, closed by the stale bot in August without a review, and its branch was deleted in September. @thswlsqls, if you'd like to continue it, I'll step aside; otherwise I'd like to pick this up and credit your work. The plan is to apply the S3 access grants and user agent configurations in AssumeRoleAwsClientFactory.s3() at the same position as DefaultAwsClientFactory.s3(), between the signer and retry configurations.

binarybrain-009 avatar Oct 29 '26 14:10 binarybrain-009