Repository navigation
feat(huaweicloud-obs): add IAM agency credential granter - #964
Merged
Merged
Conversation
Implements the Huawei Cloud OBS increment tracked by #807 / #963. AgencyGrant binds an IAM agency and delegating domain. AgencyGranter signs the assume_role request with SDK-HMAC-SHA256, accepts permanent and temporary source credentials, and returns the existing OBS Credential with the exact IAM expires_at. Credential now stores absolute expiration and checks it in is_valid_at, so the existing OBS signer bounds header signing and presigning. Existing constructors keep their no-expiry behavior. Synthetic tests cover the exact request and signature, the official SDK signing vector, source and duration validation, redacted terminal errors, post-I/O expiry, and reuse of the issued credential through Signer.
PsiACE
approved these changes
Nov 19, 2026
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #963. Part of #807.
Problem
OBS could sign with temporary Huawei Cloud credentials but had no service-local
GrantCredentialpath for IAM agency issuance, and itsCredentialcould not retain the issued expiration. Without the authoritativeexpires_at, a granted credential could be used past its real lifetime, particularly when presigning.Behavior
Credentialnow carriesexpires_at: Option<Timestamp>.Credential::newkeeps its original three-argument, no-expiry behavior;with_expires_atcovers the known-expiry path. Existing struct-literal callers must switch to the constructors, as noted in the service changelog.AgencyGrantbinds the IAM agency and delegating domain.AgencyGrantersignsPOST /v3.0/OS-CREDENTIAL/securitytokenswithSDK-HMAC-SHA256, accepts permanent and temporary source credentials withX-Security-Token, validates the documented 900–86400 second duration, and returns the existingCredentialwith the exact IAMexpires_at.No policy, session-user input, default-chain insertion, or cross-service authorization model is added.
Validation
cargo test -p reqsign-huaweicloud-obscargo test --no-fail-fast(workspace)cargo test --doc -p reqsign-huaweicloud-obs --all-featurescargo clippy --workspace --all-targets --all-features -- -D warningscargo check -p reqsign-huaweicloud-obs --target wasm32-unknown-unknowncargo fmt --all -- --checkhawkeye checkTests use fixed clocks, synthetic keys, and an injected mock
HttpSend; they cover exact request bytes and a golden SDK signature, the official Go SDK signing vector, source and duration validation, terminal error redaction, post-I/O expiry, and reuse of the issued credential throughSigner. No cloud calls or real credentials are used.The OBS signing-diagnostic redaction from #960 is merged into
mainand integrated in this head; this change does not modifysign_request.rs.