common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
1.06k stars 94 forks source link

Add method to profile to fetch the correct sso region and sso start url #544

Closed JoshuaWilkes closed 11 months ago

JoshuaWilkes commented 11 months ago

What changed?

Fixes #519

In #530 I introduced support for multiple SSO users by reworking our implementation of sso sessions. When testing this I used a profile which used granted_ prefixes for credential process.

There was a difference in how Granted processed the profile sections.

The issue was that our SSO Assumer would check the value of AWSProfile.SSORegion directly to configure the sso sdk. This ignored the fact that a profile may be using the AWSPRofile.SSOSession.SSORegion

This behaviour changed when we switched from custom support for session sections to the standard SDK support.

Why?

How did you test it?

I tested this with a profile using granted_ prefixes and one without

This code change also affects/fixes an undetected bug with the --export-all-env-vars flag which would have also exported the wrong ssoRegion and startURL

tested this using assume --export-all-env-vars followed by env | grep AWS

Potential risks

Is patch release candidate?

Link to relevant docs PRs