[Key Vault] Support CAE in challenge auth policy#37358
Conversation
|
API change check API changes are not detected in this pull request. |
...yvault-administration/azure/keyvault/administration/_internal/async_challenge_auth_policy.py
Outdated
Show resolved
Hide resolved
...ault/azure-keyvault-administration/azure/keyvault/administration/_internal/http_challenge.py
Outdated
Show resolved
Hide resolved
sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py
Outdated
Show resolved
Hide resolved
|
Can we reuse the code we added into core? #37652 |
@xiangyan99 unfortunately I don't know if we could effectively borrow the Core implementation. Our |
In fact, I was wondering if we could reuse the code to parse claims, challenges, etc. |
Okay, understood! Yeah, we can align some of the parsing logic. I had borrowed the claims parsing logic largely from |
We can revisit it in MQ. :) |
...yvault-administration/azure/keyvault/administration/_internal/async_challenge_auth_policy.py
Outdated
Show resolved
Hide resolved
|
Given you implement your own auth policy, you may need something like #36565 to support the new protocol. |
@xiangyan99 This support is now implemented (and tested by all of our policy tests) in 93c7eaa 🙂 |
Description
Resolves https://github.com/Azure/azure-sdk-for-python-pr/issues/919. Based on Azure/azure-sdk-for-java#41814. The
HttpChallengemodel now has aclaimsattribute, which contains the decoded claims from an authentication challenge if one is present. Parsing logic is largely pulled from the_parse_claims_challengeutility inazure-mgmt-core.In order to support the unique challenge flow that KV+CAE enables -- where we handle two consecutive challenges -- we need to implement the
sendmethod on the KV challenge auth policy. Doing so on the async side requires some awaiting logic that's been lifted fromazure-coreutilities.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines