Skip to content
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

Dot-delimited profile names are escaped when written to the credentials file #392

Closed
jalaziz opened this issue Feb 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jalaziz
Copy link

jalaziz commented Feb 6, 2023

Describe the bug

The AWS CLI (and other tooling) allows profile names to contain dots (e.g. myprofile.admin). Leapp seems to support dot-delimited profile names too, except for when the profile is written to the credentials file, the dots are escaped (e.g. myprofile\.admin). While this may seem perfectly valid, the AWS CLI fails to load the profile with the unescaped name.

I've done some digging and the issue is not strictly a Leapp problem. The escaping is done in ini lib when the credential file is written here. Up until that point, the profile name is correctly unescaped. It seems that the ini lib does support unescaped dots in section headers, but only for nested keys.

Leapp Version
0.17.1

To Reproduce
Steps to reproduce the behavior:

  1. Create an AWS session with the named profile myprofile.admin
  2. Start the session
  3. Attempt to use the profile using aws sts get-caller-identity --profile myprofile.admin
  4. Observe the error: The config profile (myprofile.admin) could not be found

Expected behavior
The profile should be found and the identity of the authenticated user should be returned.

Desktop (please complete the following information):

  • OS: macOS
  • OS Version: 13.2
  • Leapp Version: 0.17.1

Additional context

It's not super clear where this should be fixed. One option would be for Leapp to convert dot-delimited profile names into nested objects. Another option would be to try to fix this upstream in the ini library by introduce a new encode option.

I'd be happy to contribute a fix, but I'm curious which approach is preferred.

Some related issues:

@jalaziz jalaziz added the bug Something isn't working label Feb 6, 2023
@ericvilla
Copy link
Contributor

ericvilla commented Feb 14, 2023

We've just released Leapp v0.17.3 which solves the reported issue. I'm going to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants