Skip to content

fix: Only read the cached token of the SSO profile used - #12

Merged
ducdetronquito merged 1 commit into
mainfrom
feature/sord-2179
Sep 30, 2026
Merged

ducdetronquito merged 1 commit into
mainfrom
feature/sord-2179

Conversation

@ducdetronquito

@ducdetronquito ducdetronquito commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes SSO bearer token selection and validation on the credential path; behavior differs when multiple SSO sessions are cached.

Overview
Fixes SSO login so the CLI uses the same cached token as AWS CLI for the profile’s sso_session, instead of scanning the cache directory and picking the first JSON file with an accessToken.

SsoConfig now carries profile and sso_session_name. get_bearer_token opens ~/.aws/sso/cache/{sha1(session)}.json (via new sha1 dependency), deserializes accessToken / expiresAt, rejects expired tokens, and surfaces aws sso login --profile … hints on failure.

Unit tests cover the SHA-1 cache filename and expiration handling.

Reviewed by Cursor Bugbot for commit 1a57cec. Bugbot is set up for automated code reviews on this repo. Configure here.

@ducdetronquito
ducdetronquito requested a review from a team September 30, 2026 18:31
@ducdetronquito
ducdetronquito requested a review from a team as a code owner September 30, 2026 18:31
@ducdetronquito ducdetronquito self-assigned this Sep 30, 2026
@ducdetronquito
ducdetronquito merged commit 5271ecd into main Sep 30, 2026
2 checks passed
@ducdetronquito
ducdetronquito deleted the feature/sord-2179 branch September 30, 2026 18:39
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.

1 participant