[Identity] Implement new protocol for all credentials#36882
[Identity] Implement new protocol for all credentials#36882pvaneck merged 9 commits intoAzure:mainfrom
Conversation
|
API change check APIView has identified API level changes in this PR and created following API reviews. |
c6754dd to
d7a9499
Compare
sdk/identity/azure-identity/azure/identity/_credentials/azd_cli.py
Outdated
Show resolved
Hide resolved
|
For each credential, let's add tests Btw, we don't need TokenCredential in corehttp. corehttp only has SupportsTokenInfo. |
d7a9499 to
473231c
Compare
Yep, for Can add additional isinstance checks for |
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
a2da5b8 to
cf0e44c
Compare
sdk/identity/azure-identity/azure/identity/_internal/interactive.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
left a comment
There was a problem hiding this comment.
Now the chained credential should take TokenProviders rather than TokenCredentials, right?
Also its get_token should call into get_token_info
(We will support the case that user adds SupportsTokenInfo cred into the chain)
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
sdk/identity/azure-identity/azure/identity/_credentials/shared_cache.py
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/azure/identity/_internal/interactive.py
Outdated
Show resolved
Hide resolved
- Updated some typing - Propagated refresh_on in additional places - Propagated "token_type" for InteractiveCredential Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
All credentials now implement the `SupportsTokenInfo/AsyncSupportsTokenInfo` protocol, by each having a `get_token_info` method implementation. This allows for more extensible authentication constructs. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Based on: #36565
get_token_info.get_tokenwere parameterized to call bothget_tokenandget_token_info.azure-corebumped since we need to import the newSupportTokenInfoprotocol andAccessTokenInfoclass.