Nike-Inc / gimme-aws-creds

A CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials
Apache License 2.0
919 stars 262 forks source link

Unable to use comments in .okta_aws_login_config #434

Closed guinuxbr closed 3 months ago

guinuxbr commented 11 months ago

Expected Behavior

Considering that configparser syntax is being used, I was expecting to be able to have comments in the file .okta_aws_login_config by using "#" or ";"

Current Behavior

As soon as I run the container, all comments added to .okta_aws_login_config are overwritten.

Possible Solution

It would be nice to handle the comments possibly ignoring the characters "#" and/or ";" while parsing the configuration file.

Steps to Reproduce (for bugs)

  1. Add comments to .okta_aws_login_config using "#" and/or ";".
  2. Run gimme-aws-creds -p profile_name
  3. Check .okta_aws_login_config and the comments are gone.

Context

This is a "nice to have" when you are dealing with several different profiles. It would be nice to have the ability to add comments to make it easier to understand details about the AWS Role being assumed. It would also help to onboard new colleagues when sharing .okta_aws_login_config.

Your Environment

epierce commented 6 months ago

I'm not able to replicate this - comments starting with "#" and ";" stay in the file unless I run --configure (which I would expect to clear comments and write out a fresh config block)

guinuxbr commented 6 months ago

Thanks for checking, @epierce.

I'll test again next week and let you know.

epierce commented 3 months ago

Closing this since we haven't heard anything back

guinuxbr commented 3 months ago

Sorry, mate. I thought I had already answered this. I've tested the latest version, and it worked fine. I don't know what caused the issue before. Thank you anyway.