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/05/18 09:13:36 UTC
[I] Add service-level dynamic credential providers [opendal-reqsign]
Xuanwo opened a new issue, #748:
URL: https://github.com/apache/opendal-reqsign/issues/748
## Background
Some storage systems receive temporary, scoped credentials from an external control plane instead of from the machine-level default credential chain. For example, a catalog or namespace service may authorize access to a table and return short-lived credentials that are restricted to that table's object-store prefix.
This is different from the existing default credential chain. Default providers describe machine or runtime identity, while these credentials are object/user/request scoped and must take precedence only when the application explicitly wires them in.
## Proposal
Add service-level dynamic credential providers. Each service crate should own its own dynamic abstraction and return that service's typed `Credential` directly.
```rust
// reqsign_aws_v4
pub trait DynamicCredentialSource {
fn fetch_credential(
&self,
ctx: &Context,
) -> impl Future<Output = Result<Option<Credential>>> + MaybeSend;
}
pub struct DynamicCredentialProvider<S> {
source: S,
}
```
The provider implements the existing `ProvideCredential` trait:
```rust
impl<S> ProvideCredential for DynamicCredentialProvider<S>
where
S: DynamicCredentialSource,
{
type Credential = Credential;
async fn provide_credential(&self, ctx: &Context) -> Result<Option<Self::Credential>> {
self.source.fetch_credential(ctx).await
}
}
```
Expected service crates:
- `reqsign_aws_v4::DynamicCredentialProvider<S>`
- `reqsign_google::DynamicCredentialProvider<S>`
- `reqsign_azure_storage::DynamicCredentialProvider<S>`
Applications can put the dynamic source ahead of the normal default chain explicitly:
```rust
let provider = reqsign_aws_v4::DefaultCredentialProvider::new()
.push_front(reqsign_aws_v4::DynamicCredentialProvider::new(source));
```
## Why service-level instead of reqsign-core
`reqsign-core::ProvideCredential` is already generic over the service credential type. A global dynamic credential map in core would either need to encode service-specific field names or force every service to parse a generic shape that core cannot validate.
Keeping this inside each service crate has cleaner boundaries:
- AWS returns `reqsign_aws_v4::Credential` with access key, secret key, optional session token, and expiration.
- Google returns `reqsign_google::Credential`, usually with a token and expiration for this use case.
- Azure returns `reqsign_azure_storage::Credential`, usually a SAS token for this use case.
If a user has a generic map from a catalog, namespace, or secret manager, each service can add a small convenience adapter such as `MapCredentialSource` or `from_map` without making that map shape part of `reqsign-core`.
## Refresh behavior
No new signer-level cache should be required. `Signer` already reloads credentials when the cached credential fails `SigningCredential::is_valid()`. Dynamic providers should rely on each service credential's existing expiration semantics.
This means dynamic credentials must preserve expiration information when available. For AWS and Google this already matches the current credential models. Azure needs one API fix before this works correctly for SAS tokens: `Credential::SasToken` should carry an optional expiration timestamp and include it in `SigningCredential::is_valid()`, similar to `BearerToken`.
## Non-goals
- Do not add a global `reqsign_core::DynamicCredentialProvider`.
- Do not make reqsign responsible for catalog or namespace authorization.
- Do not make reqsign's default provider chain include dynamic credentials automatically.
- Do not bake Lance/object_store `storage_options` field names into core APIs.
## Open questions
- Should service-level dynamic traits be object-safe, or is the existing `MaybeSend` + generic provider style enough?
- Should each service expose a map-based adapter as a convenience, or leave map parsing entirely to downstream applications?
- Should the Azure SAS expiration change be done first as an independent compatibility-focused issue?
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document external dynamic credentials using ProvideCredential [opendal-reqsign]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #748: Document external dynamic credentials using ProvideCredential
URL: https://github.com/apache/opendal-reqsign/issues/748
--
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