[Core] Add new token class and protocols#36565
Merged
pvaneck merged 11 commits intoAzure:mainfrom Sep 5, 2024
Merged
Conversation
Collaborator
|
API change check APIView has identified API level changes in this PR and created following API reviews. |
25b5a53 to
ef7f41b
Compare
pvaneck
commented
Jul 24, 2024
pvaneck
commented
Jul 25, 2024
sdk/core/azure-core/azure/core/pipeline/policies/_authentication.py
Outdated
Show resolved
Hide resolved
60904c4 to
dfa0f3a
Compare
3e39891 to
ab35a3b
Compare
xiangyan99
reviewed
Aug 9, 2024
sdk/core/azure-core/azure/core/pipeline/policies/_authentication.py
Outdated
Show resolved
Hide resolved
xiangyan99
reviewed
Aug 9, 2024
xiangyan99
reviewed
Aug 9, 2024
xiangyan99
reviewed
Aug 9, 2024
xiangyan99
reviewed
Aug 12, 2024
94ac2ea to
21d7dc3
Compare
Adding new protocols to enable more expansive access tokens. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
21d7dc3 to
74854d2
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
reviewed
Aug 21, 2024
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
reviewed
Aug 21, 2024
sdk/core/azure-core/azure/core/pipeline/policies/_authentication.py
Outdated
Show resolved
Hide resolved
xiangyan99
reviewed
Aug 22, 2024
xiangyan99
reviewed
Aug 22, 2024
sdk/core/azure-core/azure/core/pipeline/policies/_authentication_async.py
Show resolved
Hide resolved
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
approved these changes
Sep 5, 2024
Member
Author
|
CI failures are unrelated to the changes in this PR and have to do with engsys issues that cropped up recently. The failing pipelines just passed yesterday. |
Member
Author
|
/check-enforcer override |
This was referenced Sep 23, 2024
6 tasks
l0lawrence
pushed a commit
to l0lawrence/azure-sdk-for-python
that referenced
this pull request
Feb 19, 2025
Add new AccessTokenInfo class and supporting protocols AsyncSupportsTokenInfo and SupportsTokenInfo. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here, we add a few new classes to core to support adding/using more data in access tokens received from credentials.
AccessTokenInfo: A new alternative class toAccessTokenwhich isn't tuple-based and supportsrefresh_onas well as future extensibility. This naming indicates it's more of a container class for a token and token metadata.SupportsTokenInfo: A newProtocolclass. This specifies the methodget_token_info.TokenRequestOptionswill be a TypeDict that will maintain the optional options for token requests, and will be used in theget_token_infomethod signature. This helps us move away from having to keep adding new kwargs toget_token's method signature every time we need to add new parameters.AsyncSupportsTokenInfo: The async counterpart toSupportsTokenInfo.Our
BearerTokenCredentialpolicies will check if a credential has theget_token_infomethod. If so, call it. Otherwise, just callget_token.