feat(aliyun): add STS AssumeRole granter - #848
Open
tonghuaroot wants to merge 1 commit into
Open
Conversation
Add AssumeRoleGrant and AssumeRoleGranter implementing GrantCredential for Alibaba Cloud RAM STS AssumeRole, mirroring the AWS granter. The source credential supplied by Granter signs the STS request directly; the returned credential carries exact expiration and is never cached. Supports an optional session policy and maps expires_in to DurationSeconds (900..=43200). Extract the shared STS request construction, HMAC-SHA1 signing, and response parsing into a new assume_role module so both the granter and the existing AssumeRoleCredentialProvider reuse it; the provider keeps its public API.
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.
Resolves #847. Part of #807.
Adds
AssumeRoleGrantandAssumeRoleGranterfor Alibaba Cloud RAM STSAssumeRole, implementingGrantCredentialin the same shape as the AWS granter (#813). The source credential supplied byGrantersigns the STS request directly; the returned credential carries exactExpirationand is never cached.expires_inmaps toDurationSeconds(900..=43200), and an optional inline sessionPolicyis supported.The STS request build, HMAC-SHA1 signing, and response parsing are extracted into a shared
assume_rolemodule that both the granter and the existingAssumeRoleCredentialProviderreuse. The provider keeps its public API andProvideCredentialis unchanged.Testing
cargo fmt,cargo clippy --all-targets --all-features -- -D warnings, andcargo testall pass.HttpSend: golden signature over the exact signed parameter set, parameter assertions, and the source-validation, duration-range, and post-I/O expiry error paths. The existing provider signature test still passes, confirming the extracted signing is byte-identical.Real-service CI coverage needs Actions secrets and is tracked in #825; happy to follow up on that wiring.
This change was written with AI assistance; I have reviewed and understand it.