Skip to content

AWS: Apply S3 access grants and user agent config in AssumeRole s3() - #17246

Draft
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/assumerole-s3-access-grants-user-agent
Draft

AWS: Apply S3 access grants and user agent config in AssumeRole s3()#17246
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/assumerole-s3-access-grants-user-agent

Conversation

@thswlsqls

@thswlsqls thswlsqls commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes #17245

Summary

  • AssumeRoleAwsClientFactory.s3() skipped applyS3AccessGrantsConfigurations and applyUserAgentConfigurations, so assume-role S3 clients ignored s3.access-grants.enabled and never set the s3fileio/ user agent.
  • This PR applies both in the same order as the sibling DefaultAwsClientFactory.s3(): signer -> access grants -> user agent -> retry.
  • Independent scope: this covers the s3 access-grants/user-agent parity gap only, separate from open PR AWS: Apply glue/kms endpoint overrides in AssumeRoleAwsClientFactory #17049 by the same author, which changes the same files for glue/kms endpoint config.

Testing done

  • Added TestAwsClientFactories#testAssumeRoleAwsClientFactoryS3AppliesUserAgent (asserts the built S3 client's user agent prefix starts with s3fileio/) and #testAssumeRoleAwsClientFactoryS3AppliesS3AccessGrants (builds s3() with access grants enabled).
  • ./gradlew :iceberg-aws:spotlessCheck :iceberg-aws:test --tests "org.apache.iceberg.aws.TestAwsClientFactories" — 23 tests passed, 0 failed.
  • Full :iceberg-aws:check was not run: it pulls in testcontainers/Docker integration tests that do not complete locally. aws is not a revapi module, so revapi is skipped.

AI Disclosure

  • Tool: Claude Code — used to analyze the code, implement the fix, and write the test.

AssumeRoleAwsClientFactory.s3() skipped applyS3AccessGrantsConfigurations
and applyUserAgentConfigurations, which the sibling DefaultAwsClientFactory.s3()
applies between the signer and retry configurations. As a result, S3 clients
built through the assume-role factory did not enable the S3 Access Grants
plugin or the "s3fileio/" user agent prefix, even when configured.

Add the two mutations in the same order as DefaultAwsClientFactory.s3()
(signer -> access grants -> user agent -> retry) so both factories apply the
same S3 configuration.

Generated-by: Claude Code
@github-actions github-actions Bot added the AWS label Jul 16, 2026
@thswlsqls
thswlsqls marked this pull request as draft July 17, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant