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

Multi-auth trait support #3233

Merged
merged 10 commits into from
Aug 15, 2024
Merged

Multi-auth trait support #3233

merged 10 commits into from
Aug 15, 2024

Conversation

SamRemis
Copy link
Contributor

@SamRemis SamRemis commented Aug 6, 2024

Adds support for the new 'auth' trait on our models that will allow a priority list of auth types for a service or operation

Adds support for the new multi-auth trait that will allow a service or operation to specify a list of compatible authentication types
Run pre-commit and add test updates
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.16%. Comparing base (c68aa1a) to head (12995d3).
Report is 89 commits behind head on develop.

Files Patch % Lines
botocore/handlers.py 90.90% 1 Missing ⚠️
botocore/regions.py 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3233      +/-   ##
===========================================
+ Coverage    93.12%   93.16%   +0.03%     
===========================================
  Files           66       66              
  Lines        14252    14287      +35     
===========================================
+ Hits         13272    13310      +38     
+ Misses         980      977       -3     

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

.changes/next-release/enhancement-signing-83434.json Outdated Show resolved Hide resolved
botocore/config.py Outdated Show resolved Hide resolved
botocore/auth.py Outdated Show resolved Hide resolved
botocore/model.py Outdated Show resolved Hide resolved
botocore/client.py Outdated Show resolved Hide resolved


def assert_all_requirements_match(auth_config, message):
if len(auth_config) > 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usually best to avoid conditionals in tests if possible. Branching like this leads to subtle failures where we may no longer meet the conditional and now the tests "pass" but do nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this comment unresolved as there is still an if statement in this test, but this one is gone. Now there is just the if statement above:

           if operation_model.auth:
                auth_operations.append([service, operation_model])

Any alternatives that I can come up with involve loosening the checks of this test for no benefit and checking many empty lists to confirm that they are indeed empty.

tests/unit/auth/test_auth_trait.py Outdated Show resolved Hide resolved
tests/unit/test_client.py Outdated Show resolved Hide resolved
tests/unit/test_handlers.py Outdated Show resolved Hide resolved
tests/unit/test_handlers.py Show resolved Hide resolved
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more small comments but otherwise I think this is looking good.

botocore/auth.py Show resolved Hide resolved
tests/functional/test_auth_config.py Outdated Show resolved Hide resolved
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple minor items, but this should be fine to ship if we've validated against our downstream consumers.

.changes/next-release/enhancement-signing-83434.json Outdated Show resolved Hide resolved
botocore/client.py Outdated Show resolved Hide resolved
@SamRemis SamRemis merged commit 4351ace into boto:develop Aug 15, 2024
34 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Aug 16, 2024
* release-1.35.0:
  Bumping version to 1.35.0
  Update endpoints model
  Update to latest models
  Multi-auth trait support (#3233)
hswong3i pushed a commit to alvistack/boto-botocore that referenced this pull request Aug 17, 2024
* Multiauth

Adds support for the new multi-auth trait that will allow a service or operation to specify a list of compatible authentication types

---------

Co-authored-by: Nate Prewitt <[email protected]>
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