-
Notifications
You must be signed in to change notification settings - Fork 827
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
STS AssumeRole Session Tags implementation #685
Conversation
vault/config.go
Outdated
if transitiveSessionTags := psection.TransitiveSessionTags; transitiveSessionTags != "" && len(config.TransitiveSessionTags) == 0 { | ||
for _, tag := range strings.Split(transitiveSessionTags, ",") { | ||
config.TransitiveSessionTags = append(config.TransitiveSessionTags, strings.TrimSpace(tag)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you split this logic out into it's own function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check the latest change, I created a couple of setters for vault.Config
that parse string into the corresponding map and slice.
I'm not 100% confident that it's the best approach - it's "economical", but kind of moves parsing away from vault.ProfileSection
to vault.Config
. Please tell me your thoughts on that.
profile.TransitiveSessionTags = append(profile.TransitiveSessionTags, strings.TrimSpace(tag)) | ||
} | ||
log.Printf("Using transitive_session_tags %v from AWS_TRANSITIVE_TAGS", profile.TransitiveSessionTags) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably shares some logic with this?
… tags; Added tests for the functions
c2dea8e
to
a3e7912
Compare
@stanvit Thanks a lot for the PR, this is definitely needed, looking forward to seeing this merged 🎉 |
@mtibben : anything required to get this PR merged -- I am happy to chip in with any updates. |
This PR is trying to resolve #684 and implements the way to set Session Tags and Transitive Session Tags when
AssumeRole()
provider is used.session_tags
andtransitive_session_tags
AWS_SESSION_TAGS
andAWS_TRANSITIVE_TAGS
It is possible to configure each profile in the chain individually, as well as the target profile with environment variables.