Skip to content

feat(services/s3): support explicit AWS profiles#7949

Draft
Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/issue-7944-s3-profile
Draft

feat(services/s3): support explicit AWS profiles#7949
Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/issue-7944-s3-profile

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jul 24, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #7944.

Rationale for this change

S3Builder currently either uses the ambient AWS_PROFILE or 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?

  • Add S3Config::profile, its aws_profile alias, and S3Builder::profile.
  • Apply the configured profile through reqsign's DefaultCredentialProviderBuilder::with_profile, preserving explicit profile > AWS_PROFILE > default precedence.
  • Keep disable_config_load authoritative and leave custom credential_provider_chain behavior unchanged.
  • Install reqsign's Tokio command executor so profiles using credential_process work.
  • Temporarily pin the core workspace's reqsign crates to commit 478f4c42713ab90e8a817e0fc4fa0d7469bfce06 until these APIs receive a formal release. All reqsign crates use the same revision because the new reqsign-core API is not compatible with the currently released sibling crates.
  • Add regression coverage for explicit profile selection, ambient profile fallback, and disabled config loading.

Are there any user-facing changes?

Yes. S3 users can select an AWS profile per builder through S3Builder::profile, profile in serialized configuration, or the aws_profile compatibility alias. The selected profile applies consistently to shared AWS config and credentials files, SSO, and credential_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 warnings
  • cargo build --locked --target wasm32-unknown-unknown --no-default-features --features=services-s3
  • cargo check --workspace --all-targets --all-features --locked
  • cargo fmt --all -- --check
  • ./scripts/workspace.py cargo fmt -- --check
  • taplo format --check

AI Usage Statement

OpenAI Codex with a GPT-5 model assisted with analysis, implementation, and validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: Allow S3Builder to select an AWS profile explicitly

1 participant