-
Notifications
You must be signed in to change notification settings - Fork 776
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
Pop explicit credentials when switching profiles #178
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the right fix. We should still be able to pull creds from env var if no explicit profile is given (aws-shell
with no args). Instead I would just expect us to explicitly set the profile when invoking the CLI command.
@jamesls This will still allow us to pull creds from the env vars if no explicit profile is set. The code in the PR is only executed if I had thought of adding a |
@joguSD I also don't think popping the environment variables is the right thing to do either. I actually think we should not be setting the The best option in general would be to set the profile on the session. However, we do not have access to that as the command is ran in a subprocess. So for now the best you probably would be able to do is set |
@kyleknap I can see where you're coming from about the environment variables thing, but I'm not sure if it's entirely relevant in the current state of variable support of the shell. Upon entering the I really don't think the behavior of |
The CLI will prefer explicit AWS credentials in the environment variables thus ignoring the profile set by the shell. If you manually invoke a profile using the shell this will ensure that any explicit credentials are removed from the shell's environment.
Fixes #166