feat(object-store): add explicit IRSA and ECS credential storage options - #8103
Open
westonpace wants to merge 5 commits into
Open
feat(object-store): add explicit IRSA and ECS credential storage options#8103westonpace wants to merge 5 commits into
westonpace wants to merge 5 commits into
Conversation
westonpace
force-pushed
the
feat/explicit-credential-storage-options
branch
from
July 30, 2026 19:53
fcd4f6d to
1ae2274
Compare
Users connecting to two S3 buckets with different AWS auth methods (e.g. IRSA for one, ECS/pod identity for another) previously had no way to override credential resolution per-bucket because DefaultCredentialsChain reads the process environment and ProviderConfig::with_env() is pub(crate). This adds new storage options to explicitly configure AWS credential providers without relying on environment variables: - IRSA: aws_web_identity_token_file + aws_role_arn (+ optional aws_role_session_name) - ECS: aws_container_credentials_full_uri or aws_container_credentials_relative_uri (+ optional aws_container_authorization_token_file) Credential resolution precedence: static access keys → IRSA → ECS → DefaultCredentialsChain. The key design: with_env_s3() now excludes credential-selection keys (WebIdentityTokenFile, RoleArn, ContainerCredentials*, etc.) from environment injection. DefaultCredentialsChain already reads these from the process environment directly, so omitting them from injection loses nothing. After this change, any IRSA/ECS key in the storage options map can only have come from the user — explicit options naturally take precedence over environment variables with no additional tracking needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
westonpace
force-pushed
the
feat/explicit-credential-storage-options
branch
from
July 30, 2026 20:58
1ae2274 to
1112178
Compare
westonpace
marked this pull request as ready for review
July 31, 2026 12:58
Member
Author
|
I attempted several other approaches:
|
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.
We can programmatically set access key id / secret key via storage_options. However, there is no way to programmatically configure IRSA or ECS authentication methods.
This was a problem for a user that wanted to connect to two different buckets, one with IRSA, and the other with ECS. Since they had environment variables set for both IRSA and ECS then AWS would always prefer IRSA.
This PR adds a new storage option,
aws_provider_scheme, which can be used in this situation. If set toirsathen it will configure a provider chain that only looks for IRSA environment variables (and will fail if they are not set). If set toecsthen it will configure a provider chain that only looks forECSenvironment variables (and will fail if they are not set). I also addedtokenjust for completeness.