victorskl / yawsso

Yet Another AWS SSO - sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials
MIT License
302 stars 26 forks source link

Rename profile on sync #50

Closed supergibbs closed 3 years ago

supergibbs commented 3 years ago

Not sure if a wider problem but the dotnet sdk doesn't support assuming a role with the source_profile is an SSO config. So yawsso sounds like a great workaround but the sdk decided to prioritize config file over the credentials file. When yawsso syncs I have the source_profile in both files and it still fails.

Feature request to rename a profile on sync so I cound have [profile rolesso] in config and on sync it becomes [role] in the credentials file.

Maybe yawsso -p rolesso:role? From the docs, profile names "can use letters, numbers, hyphens ( - ), and underscores ( _ ), but no spaces."

Relates to https://github.com/aws/aws-sdk-net/issues/1853

victorskl commented 3 years ago

@supergibbs Yep; sound ok to me. Just hoping; folk won't intentionally name the normal profile with colon in it! Bec it'd activate "rename" logic; if I understand correctly. Otherwise we could have a dedicated flag or a subcommand for this particular use case -- rename profile on sync -- feature. How do you think?

My org and I, myself do not use source_profile; TBH. So it's all up to community user feedback. Likewise, happy to support this feature.

Meanwhile, let me read the related issue pointer (thanks) to understand the context better.

supergibbs commented 3 years ago

Ya, I included a snippet from the docs that seems to say colons aren't allowed in profile names. I think this would be better so the rest of the functionality would still work without change. A flag or subcommand would limit to one profile probably or be harder to use. Thanks!

victorskl commented 3 years ago

colons aren't allowed in profile names.

Ah; right. Colon should work then. I agree harder to use for flag or subcommand.

Thanks for PR; I will review and test it today or tomorrow. If all good, I will release it right after.

victorskl commented 3 years ago

Released