Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SSO_START_URL lookup for credential exports #572

Merged

Conversation

cedieio
Copy link
Contributor

@cedieio cedieio commented Dec 19, 2023

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

Use `profile.SSOStartURL()` instead of `profile.AWSConfig.SSOSessionName`
when trying to export credentials. This will fail when the
config does nont have `SSO_START_URL` set on their config.

The `profile.SSOStartURL()` finds it from the session block
which provides the correct URL.

Fix for common-fate#571.
@JoshuaWilkes JoshuaWilkes merged commit 2960bc4 into common-fate:main Dec 19, 2023
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.

None yet

2 participants