feat(glue): Support AWS STS AssumeRole for Glue catalog authentication - #2396
feat(glue): Support AWS STS AssumeRole for Glue catalog authentication#2396jlambatl wants to merge 15 commits into
Conversation
… iceberg catalog crate
Kurtiscwright
left a comment
There was a problem hiding this comment.
Hi thank you for opening this PR!
|
@Kurtiscwright I think that this PR is now ready for review again. I've moved the aws components that are shared between S3Tables and Glue into an integrations crate, fixed the machete items. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
# Conflicts: # Cargo.toml # crates/catalog/glue/public-api.txt # crates/catalog/glue/src/catalog.rs # crates/catalog/s3tables/src/utils.rs
|
resynced with the main branch and fixed the conflicts. |
|
@jlambatl Please check my comments (disclosure: drafted by LLM) and rebase on main, which should resolve the security audit error. |
# Conflicts: # crates/catalog/glue/src/catalog.rs
|
@manuzhang I've reviewed your feedback and confirmed that the concerns you raised do exist. I've manually refactored the code and addressed the feedback. I've then had Codex and Gemini review it, which found some problems that have now been resolved. This Pr has become much larger than i anticipated, however I hope that it is now in a state that is more maintainable moving forward. Keen to hear feedback, thanks in advance. |
Previously, the catalog's own service endpoint override (e.g. a custom Glue or S3Tables/LocalStack endpoint passed via `endpoint_uri`) was applied to the base SdkConfig before it was used to configure the STS AssumeRoleProvider via `.configure(&base_config)`. This meant every AssumeRole call would silently target the catalog's endpoint instead of the real STS endpoint whenever a catalog endpoint override was set. Fix: build the base config used for STS authentication without any endpoint override, so STS always resolves to its real regional endpoint (or an AWS_ENDPOINT_URL_STS/profile override). The catalog's endpoint override is now applied only to the final SdkConfig returned for the catalog's own service client, after the STS-backed credentials provider has already been constructed. Addresses review comment on apache#2396 (review 4719317386).
`map_aws_to_s3_properties` previously only used the explicit `region_name` property to populate FileIO's `s3.region`. Whenever the region was instead resolved implicitly by the AWS SDK (via an AWS profile, the AWS_REGION env var, or IMDS), FileIO was left without a region, silently falling back to a default that may not match the SDK client actually used by the catalog. Fix: add a `resolved_region` parameter to `map_aws_to_s3_properties`, sourced from `sdk_config.region()` in both the Glue and S3Tables catalog constructors, used as a last-resort fallback after any explicit `s3.region`/`region_name` property. Regenerated public-api.txt for the iceberg-aws crate to reflect the new parameter. Addresses review comment on apache#2396 (review 4719317386).
…ilure RefreshingCredentialsProvider previously propagated any STS AssumeRole error the instant cached credentials crossed the 5-minute early-refresh buffer, even though the cached credentials could still be valid for real for several more minutes. A single transient STS error (throttling, a network blip, temporary IAM/STS unavailability) would therefore turn into a hard failure for every caller, instead of gracefully degrading. Fix: on a refresh failure, fall back to the cached credentials as long as their real (unbuffered) expiry is still in the future, logging a warning. Only propagate the error when there is no usable cached credential left (none cached, or actually expired). To avoid turning a sustained STS outage into a self-inflicted retry storm (every credential consumer re-attempting STS on every call, serialized behind a shared mutex held across each slow/retried attempt), failed refreshes also set a 30s backoff window during which cached-but-stale credentials are served without re-contacting STS. Adds the log crate as a dependency for the fallback warning. Addresses review comment on apache#2396 (review 4719317386).
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
Is anyone gonna be reviewing this PR? |
7dbc525 to
2c5aa69
Compare
Adds support for authenticating to the AWS Glue Data Catalog using temporary IAM credentials obtained via AWS STS AssumeRole. This enables cross-account Glue catalog access and aligns with AWS security best practices, which recommend temporary credentials over long-term static access keys.
Three new configuration properties are introduced, mirroring the naming convention already used by the S3 storage layer
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?