-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Corehttp auth flows #40084
Corehttp auth flows #40084
Conversation
API change check API changes are not detected in this pull request. |
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.
Pull Request Overview
This PR introduces support for the auth_flows keyword in bearer token authentication flows across synchronous and asynchronous pipelines.
- Updated tests to pass the new auth_flows parameter to request-handling methods.
- Modified the _authentication and _authentication_async policies to incorporate auth_flows when obtaining tokens.
- Updated CHANGELOG and added a type-ignore comment for OpenTelemetry context detachment.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sdk/core/corehttp/tests/async_tests/test_authentication_async.py | Updated test cases to pass auth_flows and modified the token credential method. |
sdk/core/corehttp/tests/test_authentication.py | Updated assertions and token request options for auth_flows. |
sdk/core/corehttp/corehttp/runtime/policies/_authentication.py | Changed on_request signature and added auth_flows support in token acquisition. |
sdk/core/corehttp/corehttp/runtime/policies/_authentication_async.py | Updated asynchronous on_request to support auth_flows. |
sdk/core/azure-core/azure/core/tracing/opentelemetry.py | Added "# type: ignore" for a detachment call. |
sdk/core/azure-core/CHANGELOG.md | Documented the addition of auth_flows support in BearerTokenCredentialPolicy. |
Comments suppressed due to low confidence (1)
sdk/core/corehttp/tests/async_tests/test_authentication_async.py:278
- Avoid using mutable default arguments. Change the default value of options to None and initialize it to {} within the function.
async def get_token_info(self, *scopes, options={):
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.
Can you explain the workflow here and how auth_flows
will be used inside a credential's get_token_info
method? Not quite sure why we need it at the policy level.
Could you also share some context on how auth_flows will be used inside a credential's get_token_info method? |
get_token_info needs to get the meta data from auth_flows. e.g. the credential needs to get the token url to know where the request should be sent to. Under current design, auth_flows is a list of auth context. We will share a sample in this release and in the sample, we will assume the first one in the list has the correct meta information for the credential. |
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.
Actually, looks like wrong changelog was updated
fix #6448 pending on new release of corehttp: Azure/azure-sdk-for-python#40084 SDK API diff is here: Azure/autorest.python#3062 --------- Co-authored-by: iscai-msft <isabellavcai@gmail.com>
fix #6448 pending on new release of corehttp: Azure/azure-sdk-for-python#40084 SDK API diff is here: Azure/autorest.python#3062 --------- Co-authored-by: iscai-msft <isabellavcai@gmail.com>
No description provided.