Skip to main content

Huawei Cloud OBS

Huawei Cloud Object Storage Service requests signed with the OBS signature.

OBS signature✓ header signing✓ query / presign— WASMdocs.rs/reqsign-huaweicloud-obs ↗

expires_in selects query authentication with AccessKeyId, Expires, and Signature parameters.

Get started​

cargo add reqsign --features huaweicloud
use reqsign::{default_context, huaweicloud};

// Environment credentials — resolved by the default chain.
let ctx = default_context();
let signer = huaweicloud::default_signer(ctx, "my-bucket");

let mut req = http::Request::builder()
.method(http::Method::GET)
.uri("https://my-bucket.obs.cn-north-4.myhuaweicloud.com/my-object")
.body(())?
.into_parts()
.0;

// Sign in place, then send with the HTTP client you already use.
signer.sign(&mut req, None).await?;

Credential expiry​

Credential has an absolute expires_at: Option<Timestamp> field. Credential::new keeps its original three-argument, no-expiry behavior; use Credential::with_expires_at when the expiration is known. The added public field means existing struct-literal construction no longer compiles, so struct-literal callers must switch to Credential::new (and with_expires_at where needed).

AgencyGrant and AgencyGranter issue Huawei Cloud IAM agency temporary credentials through Granter<Credential>. The result carries the exact IAM expires_at and can be passed directly to RequestSigner. Known-expiry credentials are rejected by header signing or presigning when they do not cover the requested operation deadline.

Credentials

Default credential chain

The default signer tries these sources in order and uses the first one that yields a credential — no configuration needed when any of them is present:

  1. Environment variables

Credential providers

Available ProvideCredential implementations. Construct any of them directly, reorder them, or compose them into your own chain — see Loading credentials: