This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new ee8afced8a docs(core): clarify Reqsign provider setup and signing
behavior (#9432)
ee8afced8a is described below
commit ee8afced8a1361d5b52fd9e8c4847d18dc41241b
Author: Xuanwo <[email protected]>
AuthorDate: Mon Nov 30 20:50:45 2026 +0800
docs(core): clarify Reqsign provider setup and signing behavior (#9432)
---
core/core/README.md | 13 +++++++---
core/core/src/docs/upgrade.md | 50 +++++++++++++++++++++++++-----------
core/core/src/raw/http_util/error.rs | 4 +--
core/core/src/raw/reqsign_context.rs | 17 ++++++++----
core/services/gcs/README.md | 12 +++++++--
core/services/gcs/src/docs.md | 8 +++++-
core/services/s3/README.md | 10 ++++++--
7 files changed, 83 insertions(+), 31 deletions(-)
diff --git a/core/core/README.md b/core/core/README.md
index e36a13e134..920aea93a8 100644
--- a/core/core/README.md
+++ b/core/core/README.md
@@ -46,14 +46,19 @@ behavior explicitly:
implementation. Wrap it in `HttpTransporter` and place it in the operator's
`OperationContext`.
-For example, the following dependencies compose S3, retry, and the reqwest HTTP
-transport without the `opendal` facade:
+The following dependencies compose S3, retry, and the reqwest HTTP transport.
+For OpenDAL versions using Reqsign 0.21, enable `reqsign-rustcrypto` on
+`opendal-core` to sign S3 requests with RustCrypto.
```shell
-cargo add opendal-core opendal-service-s3 opendal-layer-retry
-cargo add opendal-http-transport-reqwest
+cargo add opendal-core --features reqsign-rustcrypto
+cargo add opendal-service-s3 opendal-layer-retry opendal-http-transport-reqwest
```
+To choose your own crypto provider, omit `reqsign-rustcrypto` and call
+`opendal_core::reqsign_core::crypto::install_default(provider)` once before
+building operators.
+
```rust,ignore
use opendal_core::HttpTransporter;
use opendal_core::OperationContext;
diff --git a/core/core/src/docs/upgrade.md b/core/core/src/docs/upgrade.md
index afaab15d17..b3e66b59b9 100644
--- a/core/core/src/docs/upgrade.md
+++ b/core/core/src/docs/upgrade.md
@@ -148,22 +148,18 @@ timestamps before the Unix epoch. Convert a
`jiff::Timestamp` directly with
## reqsign 0.21 and crypto providers
-OpenDAL now uses reqsign 0.21 (`reqsign-core` 4.0). Request signing runs
through
-a `reqsign_core::crypto::CryptoProvider`. The new `reqsign-rustcrypto` feature
-binds reqsign's RustCrypto provider to every signing service. The `opendal`
crate
-and `object_store_opendal` enable it by default, so default builds keep signing
-requests without code changes. S3 presigning has stricter lifetime limits; see
-below.
+OpenDAL now uses reqsign 0.21 (`reqsign-core` 4.0). Request signing uses a
+`reqsign_core::crypto::CryptoProvider`. The `opendal` facade and
+`object_store_opendal` enable `reqsign-rustcrypto` by default. This feature
+supplies the RustCrypto provider when no process-wide provider is installed.
-If you build with `default-features = false` and use a signing service such as
-S3, Azure Blob, GCS, or OSS, choose one of the following. Otherwise every
signed
-request fails with `ErrorKind::ConfigInvalid`.
-
-Enable the RustCrypto provider:
+If you use the facade with `default-features = false` or depend directly on
+the split service crates, choose a provider for local signing and credential
+providers that need cryptography. For the facade, enable RustCrypto as follows.
```toml
[dependencies]
-opendal = { version = "0.59", default-features = false, features = [
+opendal = { version = "0.60", default-features = false, features = [
"services-s3",
"reqsign-rustcrypto",
] }
@@ -174,7 +170,7 @@ with `reqsign-crypto-boring`:
```toml
[dependencies]
-opendal = { version = "0.59", default-features = false, features =
["services-s3"] }
+opendal = { version = "0.60", default-features = false, features =
["services-s3"] }
reqsign-crypto-boring = "1.0"
```
@@ -192,8 +188,32 @@ With `default-features = false`, `auto-register-services`
is off, so
`Operator::from_uri("s3://...")` returns `ErrorKind::Unsupported` until you
call
`opendal::init_default_registry()` or register the service yourself.
-A provider installed with `install_default` takes precedence over
-`reqsign-rustcrypto`.
+For split-crate builds, enable `opendal-core/reqsign-rustcrypto` or call
+`opendal_core::reqsign_core::crypto::install_default` before building the
+operator. A provider installed before operator construction takes precedence
+over `reqsign-rustcrypto`.
+
+When no provider is available, the result depends on where the operation
+needs cryptography.
+
+- When OpenDAL receives a missing-provider error directly from signing, it
+ returns `ErrorKind::ConfigInvalid`. For example, S3 `presign_read` with
+ static access keys returns this error.
+- A credential provider can need cryptography while loading credentials.
+ Reqsign's credential chain continues after a provider fails. If the chain
+ yields no credential, OpenDAL can report `ErrorKind::Unexpected` with
+ `failed to load signing credential` as the source. For example, this
+ happens with Azure Blob `stat` when the chain contains only a configured
+ client-certificate provider.
+- Azure Blob `presign_read` can forward a supplied SAS without a crypto
+ provider because the SAS already contains a signature.
+
+On `wasm32-unknown-unknown`, Reqsign's RustCrypto provider lacks RSA
+PKCS#1 v1.5 signing with SHA-256. GCS uses this operation to sign URLs
+locally and to create RS256 assertions for OAuth token exchange with a
+service-account key. Run these flows on a native target or install a
+process-wide provider that supports this operation on your Wasm target
+before building the operator.
If you implement reqsign traits such as `ProvideCredential` or `SignRequest`
against `opendal::reqsign_core`, update them to the `reqsign-core` 4.0 API, and
diff --git a/core/core/src/raw/http_util/error.rs
b/core/core/src/raw/http_util/error.rs
index 0493acaf89..bc03a0ce42 100644
--- a/core/core/src/raw/http_util/error.rs
+++ b/core/core/src/raw/http_util/error.rs
@@ -42,8 +42,8 @@ pub fn new_request_credential_error(err: anyhow::Error) ->
Error {
/// Wrap a signing failure, preserving reqsign's retryability when available.
///
-/// A failure caused by a missing reqsign `CryptoProvider` returns
-/// [`ErrorKind::ConfigInvalid`], as described by
+/// When `err` is the missing-provider error from reqsign, return
+/// [`ErrorKind::ConfigInvalid`] with the remedies described by
/// [`new_crypto_provider_missing_error`].
pub fn new_request_sign_error(err: anyhow::Error) -> Error {
#[cfg(feature = "reqsign")]
diff --git a/core/core/src/raw/reqsign_context.rs
b/core/core/src/raw/reqsign_context.rs
index 0c6e9ac2c3..1e5f503fa6 100644
--- a/core/core/src/raw/reqsign_context.rs
+++ b/core/core/src/raw/reqsign_context.rs
@@ -19,11 +19,18 @@ use reqsign_core::Context;
/// Create a reqsign [`Context`] for a signing service.
///
-/// A [`reqsign_core::crypto::CryptoProvider`] installed with
-/// [`reqsign_core::crypto::install_default`] before the operator is built is
-/// used for every signature. Otherwise, with the `reqsign-rustcrypto` feature
-/// enabled, the context is bound to the RustCrypto provider. Without either,
-/// signing fails with [`crate::ErrorKind::ConfigInvalid`].
+/// Install a process-wide [`reqsign_core::crypto::CryptoProvider`] with
+/// [`reqsign_core::crypto::install_default`] before building operators. If no
+/// provider is installed when this function runs and `reqsign-rustcrypto` is
+/// enabled, the context binds the RustCrypto provider.
+///
+/// Without a provider, [`Context::crypto_provider`] returns
+/// [`reqsign_core::ErrorKind::ConfigInvalid`]. If that error reaches
+/// [`crate::raw::new_request_sign_error`] directly, OpenDAL returns
+/// [`crate::ErrorKind::ConfigInvalid`]. If a credential chain continues after
+/// a provider fails and finds no usable credential, the signer can report a
+/// credential-loading error. Forwarding a supplied Azure SAS requires no
+/// local signing.
pub fn reqsign_context() -> Context {
let ctx = Context::new();
#[cfg(feature = "reqsign-rustcrypto")]
diff --git a/core/services/gcs/README.md b/core/services/gcs/README.md
index 58a311aca3..ff4cc45632 100644
--- a/core/services/gcs/README.md
+++ b/core/services/gcs/README.md
@@ -17,12 +17,20 @@ service builder, then pass it to `opendal::Operator::new`.
## Use with `opendal-core`
-Add the split crates directly:
+For OpenDAL versions using Reqsign 0.21, enable `reqsign-rustcrypto` on
+`opendal-core` to sign with a GCS service-account key on native targets.
```shell
-cargo add opendal-core opendal-service-gcs
+cargo add opendal-core --features reqsign-rustcrypto
+cargo add opendal-service-gcs
```
+To choose your own crypto provider, omit `reqsign-rustcrypto` and call
+`opendal_core::reqsign_core::crypto::install_default(provider)` once before
+building operators. Service-account key signing on `wasm32-unknown-unknown`
+requires a provider that supports RSA PKCS#1 v1.5 signing with SHA-256 on
+that target.
+
Pass a configured service builder to `Operator::new`:
```rust
diff --git a/core/services/gcs/src/docs.md b/core/services/gcs/src/docs.md
index eedb747d27..dc726b1458 100644
--- a/core/services/gcs/src/docs.md
+++ b/core/services/gcs/src/docs.md
@@ -80,7 +80,13 @@ Notes:
- When a Service Account key is provided, it will be used to create access
tokens (VM metadata will not be used).
- Explicit Service Account key, in json or path, always take precedence over
ADC-defined key paths.
-- Due to [limitation in
GCS](https://cloud.google.com/storage/docs/authentication/signatures#signing-process),
a private key is required to create Pre-signed URL. Currently, OpenDAL only
supports Service Account key.
+
+Locally signed URLs and RS256 assertions for OAuth token exchange use the
+service-account private key with RSA PKCS#1 v1.5 and SHA-256. Reqsign
+0.21's RustCrypto provider lacks this operation on `wasm32-unknown-unknown`
+even with `reqsign-rustcrypto` enabled. To use a service-account key for
+these flows, run them on a native target or install a process-wide provider
+that supports this operation on your Wasm target before building the operator.
## Example
diff --git a/core/services/s3/README.md b/core/services/s3/README.md
index b8fa1b3d18..c58274d683 100644
--- a/core/services/s3/README.md
+++ b/core/services/s3/README.md
@@ -24,12 +24,18 @@ feature. See the links below for provider configuration and
examples.
## Use with `opendal-core`
-Add the split crates directly:
+For OpenDAL versions using Reqsign 0.21, enable `reqsign-rustcrypto` on
+`opendal-core` to sign S3 requests with RustCrypto.
```shell
-cargo add opendal-core opendal-service-s3
+cargo add opendal-core --features reqsign-rustcrypto
+cargo add opendal-service-s3
```
+To choose your own crypto provider, omit `reqsign-rustcrypto` and call
+`opendal_core::reqsign_core::crypto::install_default(provider)` once before
+building operators.
+
Pass a configured service builder to `Operator::new`:
```rust