Repository navigation
feat(volcengine-tos): add STS AssumeRole granter - #965
Merged
Merged
Conversation
Add AssumeRoleGrant and AssumeRoleGranter for Volcengine STS AssumeRole. The granter consumes an existing long-lived or temporary Volcengine credential, signs the regional OpenAPI request with HMAC-SHA256 and the sts/request scope, and returns the existing TOS Credential with the issued access key, secret key, session token, and exact ExpiredTime. Add Credential::expires_at and enforce it at the exact requested signing deadline. Header signing keeps checking the signing time, while presigning now requires the credential to cover the full URL lifetime. Existing constructors keep their previous behavior and leave expiration unset; the service README records the struct-literal migration note. Keep the default provider chain unchanged and do not add granted output caching. STS failures, malformed responses, and already-expired output return typed errors without exposing policies, credentials, or raw bodies.
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.
Adds the Volcengine TOS increment of the GrantCredential tracker:
AssumeRoleGrantandAssumeRoleGranterconsume an existing long-lived or eligible temporary Volcengine credential, call the regional STSAssumeRoleOpenAPI, and return the existing TOSCredentialwith the issued access key, secret key, session token, and authoritativeExpiredTime.The request uses the OpenAPI
HMAC-SHA256signature scheme with the<date>/<region>/sts/requestscope, separate from TOS4 signing. It binds the target role TRN, session name, optional inline policy, and region. Explicit durations must be whole seconds in 900..=43200;NoneomitsDurationSecondsand uses the service default. Temporary source tokens are sent inX-Security-Tokenand included in the signed headers. The default provider chain is unchanged, and granted output is never cached.Credentialnow carriesexpires_at. Existing constructors keep their previous behavior and leave expiration unset; adding the field breaks struct-literal construction, so the service README changelog tells those callers to switch to constructors. Header signing enforces expiry at the signing time, while presigning requires the credential to cover the full requested URL lifetime. The server-providedExpiredTimeis used directly; neitherCurrentTimenor the requested duration is substituted for it.Validation was local and synthetic only:
X-Security-Token, and a policy containing spaces,+,%,&, and/.HttpSendtests cover invalid grant/duration/source rejection before I/O, endpoint validation, STS error mapping and redaction, malformed or missing response fields, exact post-I/O expiry, and credential use throughGranterandSigner.cargo fmt --all -- --check, workspace clippy with all targets/features and-D warnings, workspace tests, all-feature doctests, and WASM checks for the service and the facadevolcenginefeature pass.No real credentials or cloud calls were used. Live STS/TOS acceptance remains with #825.
Closes #962. Parent tracker: #807.