-
Notifications
You must be signed in to change notification settings - Fork 179
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
Updated tool to read/write from AWS profile configurations. #7
Conversation
With much thanks to https://github.com/venth/aws-adfs for inspiration and chunks of code.
@@ -76,9 +76,6 @@ If you have more than one role available to you, you'll be prompted to | |||
choose the role from a list; otherwise, if your credentials are correct, | |||
you'll just see the AWS keys printed on stdout. | |||
|
|||
You should ``eval`` the ``export`` statements that come out, because |
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.
Looking for advice on how to update the README to reflect the new features.
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.
How about rewriting the Usage
section of the README. Something along the lines of:
- Usage
- Configuration via environment variables (setting GOOGLE_USERNAME etc)
- Writing to a profile configuration (which arguments to use)
- Using credentials in environment variables only (leaving off profile argument)
- Running from a Docker image
- Running from a locally-installed Python package
and then, I can merge this into the bash_wrapper branch and update the section on "environment variables only"
if args.username is None: | ||
args.username = raw_input("Google username: ") | ||
|
||
if args.idp_id is None or args.sp_id is None: |
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.
Added raw_input
lookups for these values (below) if not resolved from the stored config file.
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.
LGTM 👍
if args.duration > 3600: | ||
print "Duration must be less than or equal to 3600" | ||
duration = 3600 | ||
|
||
config = prepare.get_prepared_config( |
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.
This looks up the config parameters from the ~/.aws/config
file, overwridden from cli parameters or ENV variables.
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.
Noice
aws_google_auth/__init__.py
Outdated
|
||
print "export AWS_ACCESS_KEY_ID='{}'".format(token['Credentials']['AccessKeyId']) |
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.
Possibly we could keep this as a flag or when no --profile is specified??
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.
If --profile
is specified, don't do this bit; otherwise, of course, write the profile.
For now, don't worry about the use case when writing to a |
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.
Couple of comments in the PR, mostly on the README.
Can you also bump version to 0.0.7 in setup.py
and in aws_google_auth/__init__.py
?
Updates as requested |
This PR resolves #5 by storing details in a profile in
credentials
andconfig
.That then results in:
So when you run
aws-google-auth -p cevo-demo
again it auto-fills it all and looks like:With much thanks to https://github.com/venth/aws-adfs for inspiration and chunks of code.