apache / apache/iceberg

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

Open Beginner friendly
#17,245 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.2k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
132

Description

**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:

```java
.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

Contributor guide

Open the contributing guide

Research direction

Compare AssumeRoleAwsClientFactory.s3() in aws/src/main/java/org/apache/iceberg/aws/AssumeRoleAwsClientFactory.java with DefaultAwsClientFactory.s3() in aws/src/main/java/org/apache/iceberg/aws/AwsClientFactories.java, focusing on the listed S3 configuration mutations. Done means the assume-role factory applies the S3 Access Grants configuration and s3fileio/ user-agent configuration so its behavior matches the default factory.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
backend, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.