tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://chromewebstore.google.com/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?utm_source=github
MIT License
1.32k stars 141 forks source link

Can't load a profile whose section contains a comment between the keys #195

Closed tilfin closed 3 years ago

tilfin commented 3 years ago

https://github.com/tilfinltd/aws-extend-switch-roles/issues/124#issuecomment-774188816 by @kiddom-kq

kiddom-kq commented 3 years ago

reposting in this new / dedicated thread.


Apparently the # character is also not supported inside of the [profile ...] sections.

E.G.:

[profile production-someUserRoleNameHere]
# A comment here means that the plugin will silently fail to parse the config and you'll get no entries on the popup when clicking the plugin
role_arn = arn:aws:iam::123456789012:role/someUserRoleNameHere
source_profile = production
# But a comment here is fine. This entry will show up on the popup when the extension is activated/clicked.
[profile production-someUserRoleNameHere]
role_arn = arn:aws:iam::123456789012:role/someUserRoleNameHere
source_profile = production

It took a bit of trial and error to figure that out, but eventually found that any comment inside/under the profile heading will silently fail.

While a fix would be appreciated, emitting any user visible message that parsing failed would be enough

tilfin commented 3 years ago

released at v2.1.0