Honor aws.endpoint for STS and S3 clients#1
Merged
da115115 merged 1 commit intoMay 6, 2026
Merged
Conversation
Two builders inside the server were always targeting real AWS: - AwsCredentialGenerator.StsAwsCredentialGenerator built its StsClient with .region(...).credentialsProvider(...) only. There is no endpointOverride and aws.endpoint isn't propagated, so every AssumeRole goes to sts.<region>.amazonaws.com. AWS_ENDPOINT_URL_STS / AWS_ENDPOINT_URL env vars and the matching system properties don't kick in for that builder shape -- I confirmed by pointing AWS_ENDPOINT_URL_STS at port 1 and getting back the same real-AWS InvalidClientTokenId 403, with zero traffic to the configured port (sniffer in front). - FileIOFactory.getS3Client built its S3Client the same way, with no endpointOverride and forcePathStyle(false), so any Iceberg read against a self-hosted S3-compatible backend would also miss the endpoint and reject path-style URLs. Add an aws.endpoint property + per-bucket s3.endpoint.N, plumb it through S3StorageConfig, and apply endpointOverride on both the StsClient and the S3Client when set. For the S3Client also flip to path-style when an endpoint is set, since SeaweedFS / MinIO / Ceph RGW / LocalStack typically can't issue wildcard certs for bucket.host. Default empty -> AWS path is unchanged. Two new unit tests cover "endpoint set -> endpointOverride called with that URI" and "endpoint unset -> endpointOverride never called".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two builders inside the server were always targeting real AWS:
AwsCredentialGenerator.StsAwsCredentialGenerator built its StsClient with .region(...).credentialsProvider(...) only. There is no endpointOverride and aws.endpoint isn't propagated, so every AssumeRole goes to sts..amazonaws.com. AWS_ENDPOINT_URL_STS / AWS_ENDPOINT_URL env vars and the matching system properties don't kick in for that builder shape -- I confirmed by pointing AWS_ENDPOINT_URL_STS at port 1 and getting back the same real-AWS InvalidClientTokenId 403, with zero traffic to the configured port (sniffer in front).
FileIOFactory.getS3Client built its S3Client the same way, with no endpointOverride and forcePathStyle(false), so any Iceberg read against a self-hosted S3-compatible backend would also miss the endpoint and reject path-style URLs.
Add an aws.endpoint property + per-bucket s3.endpoint.N, plumb it through S3StorageConfig, and apply endpointOverride on both the StsClient and the S3Client when set. For the S3Client also flip to path-style when an endpoint is set, since SeaweedFS / MinIO / Ceph RGW / LocalStack typically can't issue wildcard certs for bucket.host.
Default empty -> AWS path is unchanged. Two new unit tests cover "endpoint set -> endpointOverride called with that URI" and "endpoint unset -> endpointOverride never called".
PR Checklist
docsis updatedDescription of changes