common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
964 stars 91 forks source link

Allow access token to be exported to plain text on ~/.aws/sso/cache #518

Closed cedieio closed 7 months ago

cedieio commented 9 months ago

What changed?

This change would allow the access tokens to be exported to ~/.aws/sso/cache when the user run assume --export. Allowing awscli to use said token without the need to login again. Adjusted the keys for the file name as the default used is sso_session_name, sso_start_url is used if the session name is not present. Fix for issue #155.

Why?

Allows awscli to use the access token without the need to login, and allows assume to use access token from ~/.aws/sso/cache to avoid multiple logins

How did you test it?

Ran dassume --export and tested via aws s3 ls --profile test-profile and checked ~/.aws/sso/cache file location

Ran dassume --export with no granted-aws-sso-tokens on my keychain and valid access tokens on ~/.aws/sso/cache, checked the key-chain if granted-aws-sso-tokens is set, also tested in reverse(no plain-text token and has key-chain access-token)

Potential risks

Is patch release candidate?

Link to relevant docs PRs