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

Handle [sso-session] section #1088

Merged
merged 4 commits into from
Feb 3, 2023
Merged

Conversation

dima-vm
Copy link
Contributor

@dima-vm dima-vm commented Dec 9, 2022

New AWS CLI changed config format for SSO values. Instead of specifying sso_start_url and sso_region,
it now makes sso_session profile param, that points to a separate [sso-session] section.

This PR adds support for the sso_session param and parsing [sso-session] section.

vault/config.go Outdated
func (s ProfileSection) IsEmpty() bool {
s.Name = ""
return s == ProfileSection{}
}

// ProfileSections returns all the profile sections in the config
func (c *ConfigFile) ProfileSections() []ProfileSection {
result := []ProfileSection{}
var result []ProfileSection
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed IDE warning, no semantic change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@@ -218,7 +218,7 @@ func (t *tempCredsCreator) provider(config *Config) (aws.CredentialsProvider, er
if err != nil {
return nil, err
}
} else if config.HasSSOStartURL() {
} else if config.HasSSOStartURL() || config.HasSSOSession() {
return NewSSORoleCredentialsProvider(t.keyring.Keyring, config)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In proper case, both of them are true. However, [sso-session] may lack sso_start_url. In that case I feel like it should still go the SSO way.

.gitignore Outdated
@@ -1,3 +1,5 @@
/aws-vault
/aws-vault-*
/SHA256SUMS

/.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in your global gitignore

SSORegion string

// SSORegistrationScopes specifies registration scopes for the AWS IAM Identity Center user portal.
SSORegistrationScopes string

Copy link
Member

@mtibben mtibben Dec 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem this is ever used?

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.

2 participants