Xuanwo opened a new issue, #8873:
URL: https://github.com/apache/opendal/issues/8873
## Summary
Clean up and align `core/services/oss` credential loading and public exports
with `reqsign-aliyun-oss` (`3.2.x` / `0.20.9` line):
1. **Remove obsolete `StaticEnv` snapshot hack
(`core/services/oss/src/backend.rs:485-530`)**:
- The comment notes that `AssumeRoleWithOidcCredentialProvider` lacks
typed builder APIs and therefore snapshots the entire process `OsEnv` into
`StaticEnv` to inject `ALIBABA_CLOUD_ROLE_ARN`,
`ALIBABA_CLOUD_OIDC_PROVIDER_ARN`, `ALIBABA_CLOUD_OIDC_TOKEN_FILE`, and
`ALIBABA_CLOUD_STS_ENDPOINT`.
- `reqsign-aliyun-oss` already exposes typed builder methods on
`AssumeRoleWithOidcCredentialProvider`: `.with_role_arn()`,
`.with_oidc_provider_arn()`, `.with_oidc_token_file()`, `.with_sts_endpoint()`,
and `.with_role_session_name()`.
- Replace the `StaticEnv` snapshot with `OsEnv` plus the typed builder
methods.
2. **Adopt `DefaultCredentialProvider`
(`core/services/oss/src/backend.rs:532-565`)**:
- Currently `OssBuilder::build()` manually builds a chain of
`EnvCredentialProvider` + `AssumeRoleWithOidcCredentialProvider` +
`EcsRamRoleCredentialProvider`, omitting `DefaultCredentialProvider` sources
already supported by `reqsign-aliyun-oss` (`~/.oss/credentials`,
`CredentialsFileCredentialProvider`, `ConfigFileCredentialProvider`,
`CredentialsUriCredentialProvider` / `ALIBABA_CLOUD_CREDENTIALS_URI`).
- Switch to `DefaultCredentialProvider::builder()` while preserving
static credential precedence and explicit `role_arn`
`AssumeRoleCredentialProvider` wrapping (and consider exposing
`disable_config_load` for parity with other cloud services).
3. **Re-export `reqsign_aliyun_oss` (`core/services/oss/src/lib.rs`)**:
- `OssBuilder::credential_provider_chain` is already a public API taking
`reqsign_core::ProvideCredentialChain<reqsign_aliyun_oss::Credential>`, but
`core/services/oss/src/lib.rs` does not re-export `pub use reqsign_aliyun_oss;`
(unlike `s3`, `gcs`, `gcs-grpc`, `azblob`, and `azdls` after #8346).
---
*Drafted with AI assistance (Gemini 4 Neon) and verified against
`core/services/oss/src/{lib.rs,backend.rs}` and `reqsign-aliyun-oss` `v0.20.9`.*
--
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]