Xuanwo opened a new pull request, #8891:
URL: https://github.com/apache/opendal/pull/8891
# Which issue does this PR close?
Closes #8878.
# Rationale for this change
When `S3Config::disable_config_load` is enabled, `S3Builder::build`
previously called only
`DefaultCredentialProvider::builder().no_env().no_profile()`. In
`reqsign-aws-core`, the `sso`, `process`, and `web_identity` credential slots
are configured independently from `env` and `profile`:
- `SSOCredentialProvider` still reads `~/.aws/config` (`AWS_CONFIG_FILE`,
`AWS_PROFILE`) and `~/.aws/sso/cache`, contradicting `S3Builder::profile`'s
documented contract that profile selection has no effect when
`disable_config_load` is set.
- `ProcessCredentialProvider` still reads `~/.aws/config`
(`AWS_CONFIG_FILE`, `AWS_PROFILE`) and executes `credential_process` once a
command executor is attached.
- `AssumeRoleWithWebIdentityCredentialProvider` reads `AWS_ROLE_ARN`,
`AWS_WEB_IDENTITY_TOKEN_FILE`, `AWS_ROLE_SESSION_NAME`, and
`AWS_STS_REGIONAL_ENDPOINTS` purely from ambient environment variables and
local token files, with no explicit `S3Config` fields driving it (unlike
`S3Config::role_arn`, which wraps the chain in `AssumeRoleCredentialProvider`,
and unlike `S3Config::container_credentials_*`, which configures the ECS slot).
Disabling `web_identity` alongside `sso` and `process` aligns
`disable_config_load` with:
1. OpenDAL's pre-reqsign-2.0 behavior (skipping `from_profile()` and
`from_env()`) and `services/cos` (`.no_env().no_web_identity()`).
2. The credential chain ordering in `DefaultCredentialProvider` (`env ->
profile -> sso -> web_identity -> process -> ecs -> imds`), so ambient
`AWS_ROLE_ARN` / `AWS_WEB_IDENTITY_TOKEN_FILE` environment variables do not
intercept explicit container credentials (`ecs`) or EC2 instance metadata
(`imds`) when `disable_config_load` is enabled.
Compute metadata providers (`ecs` container credentials and `imds` EC2
instance metadata, controlled separately via `disable_ec2_metadata`) remain
enabled.
# What changes are included in this PR?
- Disable the `web_identity` slot unconditionally and the `sso` and
`process` slots on `#[cfg(not(target_arch = "wasm32"))]` when
`config.disable_config_load` is true in `core/services/s3/src/backend.rs`.
- Update `S3Config::disable_config_load`, `S3Builder::disable_config_load`,
`S3Builder::profile`, and `core/services/s3/src/docs.md` to document the exact
disabled and remaining credential slots, and regenerate the synced config docs
for Python, Java, .NET, and website data.
- Add deterministic unit tests in `core/services/s3/src/backend.rs` using
isolated `reqsign_core::Context` mocks confirming that:
- `sso` and `process` profiles are not read or executed when
`disable_config_load` is set,
- `AWS_ROLE_ARN` / `AWS_WEB_IDENTITY_TOKEN_FILE` web-identity credentials
are not loaded when `disable_config_load` is set, and
- configured container credentials (`ecs`) still load when
`disable_config_load` is set even with ambient profile and web-identity
environment variables present.
# Are there any user-facing changes?
Yes. Users who enable `disable_config_load` on S3 will no longer implicitly
load credentials from AWS SSO profiles, `credential_process` entries in
`~/.aws/config`, or ambient `AWS_ROLE_ARN` / `AWS_WEB_IDENTITY_TOKEN_FILE`
web-identity environment variables. Documentation and generated binding config
descriptions have been updated accordingly.
# Breaking changes
# AI Usage Statement
- Harness: pi
- Model: Gemini 4 Neon
- Effort: High
- Role: Investigated `reqsign-aws-core` provider slots and OpenDAL S3
history, implemented the `disable_config_load` fix and docstring updates,
regenerated binding/docs config files, and wrote and ran the unit tests.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]