common-fate / granted

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

Fix SSO_START_URL lookup for credential exports #572

Closed cedieio closed 6 months ago

cedieio commented 6 months ago

What changed?

Use profile.SSOStartURL() instead of profile.AWSConfig.SSOStartURL

Why?

Using profiles with session set and no sso_start_url fails when trying to assume with --export-sso-token

This is caused by directly referencing profile.AWSConfig.SSOStartURL on ExportAccessTokenToCache, which in this case should use profile.SSOStartURL()

Sample profile config

[sso-session test-session]
sso_region = ap-southeast-2
sso_registration_scopes = sso:account:access
sso_start_url = https://test.com/start#

[profile test-profile]
common_fate_generated_from = aws-sso
sso_account_id = 175914186171
sso_role_name = test-role
sso_session = nine

Fix for #571

How did you test it?

dassume --export-sso-token --export

Potential risks

Is patch release candidate?

Link to relevant docs PRs