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

Update interface for providing credentials to CRT #283

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

kyleknap
Copy link
Contributor

This is a port of this PR: aws/aws-cli#8334

The two main changes are:

  • Update the CRT S3 client factory to accept a CRT credential provider instead of a botocore credential provider. Under the hood, the S3 client only accepts a CRT credential provider. So, this provides more flexibility in being able to provide other CRT credenital providers directly instead of being forced to the botocore credential provider interface
  • Update the botocore to CRT credentials adapter interface to only accept botocore credential objects instead of credential providers. In general, the credentials object is more accessible than the provider; it can be retrieved at the session level and is what is passed into clients. Also, this change avoids a limitation where the load_credentials() method on the credential provider cannot be called more than twice for some configurations (e.g. assume role from profile), which can be an issue if you create both a botocore client and CRT S3 client.

The two main changes are:
* Update the CRT S3 client factory to accept a CRT credential
  provider instead of a botocore credential provider. Under the
  hood, the S3 client only accepts a CRT credential provider. So,
  this provides more flexibility in being able to provide other
  CRT credenital providers directly instead of being forced to
  the botocore credential provider interface
* Update the botocore to CRT credentials adapter interface to
  only accept botocore credential objects instead of credential
  providers. In general, the credentials object is more accessible
  than the provider; it can be retrieved at the session level and
  is what is passed into clients. Also, this change avoids
  a limitation where the load_credentials() method on the
  credential provider cannot be called more than twice for some
  configurations (e.g. assume role from profile), which can be
  an issue if you create both a botocore client and CRT S3 client.
@kyleknap kyleknap requested a review from nateprewitt November 21, 2023 20:54
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (01aaaf3) 83.85% compared to head (a86f7cf) 84.23%.

Files Patch % Lines
s3transfer/crt.py 0.00% 12 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           crt-enhancements     #283      +/-   ##
====================================================
+ Coverage             83.85%   84.23%   +0.38%     
====================================================
  Files                    16       16              
  Lines                  2768     2760       -8     
====================================================
+ Hits                   2321     2325       +4     
+ Misses                  447      435      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyleknap kyleknap merged commit 7b13b56 into boto:crt-enhancements Nov 21, 2023
13 checks passed
@kyleknap kyleknap deleted the crt-creds branch November 21, 2023 22:36
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.

3 participants