onelogin/onelogin-python-aws-assume-role

--profile flag doesn't include a new line before [] breaking existing creds files

bobbytables opened this issue · 2 comments

The profile name that gets slapped into the ~/.aws/.credentials file doesn't include a new line before it so it breaks the entire credentials file:

Given the flag portal:

[production]
aws_access_key_id={obfuscated}
aws_secret_access_key={obfuscasted}[portal]
aws_secret_access_key = all of this is wrong now

I will review it asap

I copied the code to handle and store credentials from the official aws-cli:
https://github.com/aws/aws-cli/blob/master/awscli/customizations/configure/writer.py

And it seems it contains the bug you reported.