You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/07/24 16:05:24 UTC
[PR] feat(services/s3): support explicit AWS profiles [opendal]
Xuanwo opened a new pull request, #7949:
URL: https://github.com/apache/opendal/pull/7949
# 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #7949:
URL: https://github.com/apache/opendal/pull/7949#discussion_r3718177987
##########
core/services/s3/src/core.rs:
##########
@@ -141,7 +142,8 @@ impl S3Core {
Context::new()
.with_file_read(reqsign_file_read_tokio::TokioFileRead)
.with_http_send(ctx.http_transport().clone())
- .with_env(reqsign_core::OsEnv),
+ .with_env(OsEnv)
+ .with_command_execute(TokioCommandExecute),
Review Comment:
Irrelevant change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #7949:
URL: https://github.com/apache/opendal/pull/7949#issuecomment-5188338247
> I remember [apache/opendal-reqsign#792](https://github.com/apache/opendal-reqsign/pull/792) and wonder why we should handle this credential loading thing in opendal rather than reqsign.
Yep, a not needed helper function. I have removed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on PR #7949:
URL: https://github.com/apache/opendal/pull/7949#issuecomment-5214512543
I'm okay with a regular patch release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on code in PR #7949:
URL: https://github.com/apache/opendal/pull/7949#discussion_r3718513566
##########
core/services/s3/src/config.rs:
##########
@@ -94,6 +94,16 @@ pub struct S3Config {
#[serde(alias = "aws_region")]
pub region: Option<String>,
+ /// AWS profile used by the default credential provider chain.
+ ///
+ /// This profile takes precedence over the `AWS_PROFILE` environment
+ /// variable and applies to shared AWS config and credentials files and SSO.
+ ///
Review Comment:
```suggestion
/// AWS profile.
///
/// By default, reqsign which is the default credential provider, supplies profile in order:
/// - explicit option
/// - `AWS_PROFILE` environment variable
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #7949:
URL: https://github.com/apache/opendal/pull/7949#issuecomment-5213640051
It's fixed in https://github.com/apache/opendal-reqsign/commit/be02d93e6754d18e9868039235b57d14d8487912, and we should do a quick bug fix for reqsign
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #7949:
URL: https://github.com/apache/opendal/pull/7949#discussion_r3718464412
##########
core/services/s3/src/core.rs:
##########
@@ -141,7 +142,8 @@ impl S3Core {
Context::new()
.with_file_read(reqsign_file_read_tokio::TokioFileRead)
.with_http_send(ctx.http_transport().clone())
- .with_env(reqsign_core::OsEnv),
+ .with_env(OsEnv)
+ .with_command_execute(TokioCommandExecute),
Review Comment:
Is it needed later or just random modification?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #7949:
URL: https://github.com/apache/opendal/pull/7949#issuecomment-5213519938
reqsign seems to have a bug which causes https://github.com/apache/opendal/actions/runs/30981065499/job/92225399610?pr=7949#logs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #7949:
URL: https://github.com/apache/opendal/pull/7949#discussion_r3718424562
##########
core/services/s3/src/core.rs:
##########
@@ -141,7 +142,8 @@ impl S3Core {
Context::new()
.with_file_read(reqsign_file_read_tokio::TokioFileRead)
.with_http_send(ctx.http_transport().clone())
- .with_env(reqsign_core::OsEnv),
+ .with_env(OsEnv)
+ .with_command_execute(TokioCommandExecute),
Review Comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #7949:
URL: https://github.com/apache/opendal/pull/7949
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #7949:
URL: https://github.com/apache/opendal/pull/7949#issuecomment-5215411238
Bumped this PR onto reqsign v0.20.5 (`reqsign-aws-v4 3.2.0`, `reqsign-core 3.3.0`, `reqsign-file-read-tokio 3.0.5`) to pick up the AssumeRole `SignatureDoesNotMatch` fix, regenerated Java/Python/docs config outputs after the profile docs tweak, and merged latest `main`.
Local checks:
- `cargo test --locked -p opendal-service-s3`
- `cargo clippy --locked -p opendal-service-s3 --all-targets -- -D warnings`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/s3): support explicit AWS profiles [opendal]
Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on code in PR #7949:
URL: https://github.com/apache/opendal/pull/7949#discussion_r3718513566
##########
core/services/s3/src/config.rs:
##########
@@ -94,6 +94,16 @@ pub struct S3Config {
#[serde(alias = "aws_region")]
pub region: Option<String>,
+ /// AWS profile used by the default credential provider chain.
+ ///
+ /// This profile takes precedence over the `AWS_PROFILE` environment
+ /// variable and applies to shared AWS config and credentials files and SSO.
+ ///
Review Comment:
```suggestion
/// AWS profile.
///
/// By default, reqsign which is the default credential provider, supplies profile in order:
/// - explicit option
/// - `AWS_PROFILE` environment variable, from which reqsign reads profile from:
/// - `~/.aws/credentials` (or the path specified by `AWS_SHARED_CREDENTIALS_FILE`)
/// - `~/.aws/config` (or the path specified by `AWS_CONFIG_FILE`)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org