Skip to content

feat(aws): resolve assume-role profile chains through SSO sources - #954

Open
Xuanwo wants to merge 3 commits into
mainfrom
xuanwo/resolve-sso-role-chains
Open

Xuanwo wants to merge 3 commits into
mainfrom
xuanwo/resolve-sso-role-chains

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 19, 2026

Copy link
Copy Markdown
Member

Fixes #856.

A selected profile with role_arn now resolves source_profile references to a static or SSO base, loads a named or legacy inline SSO source through the configured SSO slot, and assumes each role in order with the previous hop's credential. AWS_PROFILE and explicit with_profile(...) both drive the graph. no_sso() prevents SSO from participating, and role-chain or SSO failures stop resolution instead of selecting a later identity.

The graph is validated before SSO or STS network I/O: missing source profiles, cycles, both or unsupported credential_source, a missing STS region, and invalid grants produce actionable errors. Static sources, duration_seconds, and external_id are supported; credential_source-only role profiles remain explicitly unsupported.

To execute STS from the profile provider without a core-to-v4 dependency cycle or a second signing implementation, the SigV4 request body moved into reqsign-aws-core's hidden signing module and the public RequestSigner delegates to it. Crate boundaries and public re-exports are unchanged.

Validation uses synthetic profiles and mocked HTTP only, with no live cloud credentials:

  • cargo fmt --all -- --check
  • cargo clippy -p reqsign-aws-core -p reqsign-aws-v4 --all-targets --all-features -- -D warnings
  • cargo test -p reqsign-aws-core -p reqsign-aws-v4
  • cargo check -p reqsign-aws-core -p reqsign-aws-v4 --target wasm32-unknown-unknown
  • cargo check -p reqsign --features full

Coverage includes explicit and AWS_PROFILE selection, named SSO sources, multi-hop order and per-hop credentials, static sources, no_sso(), pre-I/O missing-source/cycle/conflict/region/invalid-ARN failures, and signer consumption of the final assumed credential.

Move the SigV4 request-signing body into the shared AWS core so internal STS operations can use the exact same implementation as the public request signer without adding a dependency on the SigV4 service crate.
Resolve a selected role profile through its source_profile graph, load a named or legacy SSO source through the configured SSO slot, and assume each role in order with the previous hop's credential. Validate missing sources, cycles, conflicting or unsupported credential_source, region, and grant fields before STS or SSO network I/O, and keep role-chain/SSO failures from selecting a later identity.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support assume-role profile chains backed by named SSO sessions

2 participants