feat(services/s3): support explicit AWS profiles#7949
Draft
Xuanwo wants to merge 1 commit into
Draft
Conversation
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.
Which issue does this PR close?
Closes #7944.
Rationale for this change
S3Buildercurrently either uses the ambientAWS_PROFILEor requires callers to replace the complete credential provider chain. This prevents applications from selecting different AWS profiles for different S3 operators while keeping OpenDAL's default credential resolution behavior.reqsign now provides an aggregate profile selector on its default AWS credential provider builder, so OpenDAL can expose per-builder profile selection without reconstructing or wrapping the provider chain locally.
What changes are included in this PR?
S3Config::profile, itsaws_profilealias, andS3Builder::profile.DefaultCredentialProviderBuilder::with_profile, preserving explicit profile >AWS_PROFILE>defaultprecedence.disable_config_loadauthoritative and leave customcredential_provider_chainbehavior unchanged.credential_processwork.478f4c42713ab90e8a817e0fc4fa0d7469bfce06until these APIs receive a formal release. All reqsign crates use the same revision because the newreqsign-coreAPI is not compatible with the currently released sibling crates.Are there any user-facing changes?
Yes. S3 users can select an AWS profile per builder through
S3Builder::profile,profilein serialized configuration, or theaws_profilecompatibility alias. The selected profile applies consistently to shared AWS config and credentials files, SSO, andcredential_process.This change is additive and does not alter credential resolution when no explicit profile is configured.
Validation
cargo test --locked -p opendal-service-s3— 25 unit tests passed; 7 doctests passed and 5 were ignored.cargo clippy --locked -p opendal-service-s3 --all-targets -- -D warningscargo build --locked --target wasm32-unknown-unknown --no-default-features --features=services-s3cargo check --workspace --all-targets --all-features --lockedcargo fmt --all -- --check./scripts/workspace.py cargo fmt -- --checktaplo format --checkAI Usage Statement
OpenAI Codex with a GPT-5 model assisted with analysis, implementation, and validation.