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

Add temporary credentials #226

Closed
wants to merge 5 commits into from

Conversation

garnaat
Copy link
Member

@garnaat garnaat commented Feb 4, 2014

This PR adds the low-level capability of fetching and refreshing temporary credentials. Two new methods are added to the Session object:

  • create_temporary_credentials is called to create a new set of temporary credentials. You pass in information about the service, operation, and kwargs you want to call to actually fetch the credentials. The call is made and the temporary credentials are cached locally. All subsequent calls to operations will use the cached temporary credentials. If the credentials are within 15 minutes of expiration, they will be refreshed automatically.
  • delete_temporary_credentials is called to delete the locally cached temporary credentials. Once the temporary credentials are deleted, the normal credential search path will be used to find the correct credentials to use for subsequent operations.

There will be a related PR in AWS CLI to add this capability as a new command.

@garnaat garnaat mentioned this pull request Feb 18, 2014
jamesls added a commit to jamesls/aws-cli that referenced this pull request Nov 7, 2014
This builds on the work of several existing
pull requests combining what I believe is
the combination of all the suggested changes
including:

* Use role_arn to trigger assume role behavior.
  Do not require an explicit session to be created
  and ended (aws#667).
* Cache the temporary credentials.  If the credentials
  are not expired then we should reuse them instead of
  making the assume role call every time
  (aws#656 and boto/botocore#226).

I think a strong case can be made to move this to botocore.
However, the file caching makes me somewhat hesitant to move
this into botocore (but I think the AssumeRoleProvider without
the caching could be added to botocore).  I'd like to evaluate this in
the future but for now, I don't think it's unreasonable to leave
this in the AWS CLI for the time being.  At any rate, this is
a straightforward and compatible move if we decide to do so.

Also, the ability to open a browser with the currently scoped
session has not been ported over.  I'd like to address that
in a separate pull request.
jamesls added a commit to jamesls/aws-cli that referenced this pull request Nov 8, 2014
This builds on the work of several existing
pull requests combining what I believe is
the combination of all the suggested changes
including:

* Use role_arn to trigger assume role behavior.
  Do not require an explicit session to be created
  and ended (aws#667).
* Cache the temporary credentials.  If the credentials
  are not expired then we should reuse them instead of
  making the assume role call every time
  (aws#656 and boto/botocore#226).

I think a strong case can be made to move this to botocore.
However, the file caching makes me somewhat hesitant to move
this into botocore (but I think the AssumeRoleProvider without
the caching could be added to botocore).  I'd like to evaluate this in
the future but for now, I don't think it's unreasonable to leave
this in the AWS CLI for the time being.  At any rate, this is
a straightforward and compatible move if we decide to do so.

Also, the ability to open a browser with the currently scoped
session has not been ported over.  I'd like to address that
in a separate pull request.
@jamesls
Copy link
Member

jamesls commented Nov 19, 2014

Superseded by jamesls/aws-cli@22932e5

@jamesls jamesls closed this Nov 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants