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

[keyvault] CAE support #31140

Merged
merged 33 commits into from
Oct 8, 2024
Merged

[keyvault] CAE support #31140

merged 33 commits into from
Oct 8, 2024

Conversation

timovv
Copy link
Member

@timovv timovv commented Sep 17, 2024

Packages impacted by this PR

  • @azure/keyvault-common
  • Downstream Key Vault packages

Issues associated with this PR

  • Private

Describe the problem that is addressed by this PR

In future, the Key Vault service will be adding support for Continuous Access Evaluation (CAE). This PR adds the necessary support to the SDK's challenge-based authentication policy to enable this feature.

After the initial challenge, with CAE enabled, any future request may result in a 401 response, even if the access token used is valid. This PR adds a new policy that handles this CAE challenge alongside the normal challenge. The new policy replaces the existing use of Core's bearerTokenAuthenticationPolicy, which is no longer suitable for this use case since it cannot handle a CAE challenge that comes immediately after a regular challenge.

Are there test cases added in this PR? (If not, why?)

Yes, added test cases with mock requests and responses to cover a number of different scenarios, ensuring the policy is doing the right thing.

I also manually tested against a test resource provided by the Key Vault team which returns a CAE challenge in response to any authorized request to the vault, and got the expected result (a normal challenge handled successfully, followed by a CAE challenge handled successfully, followed by another CAE challenge which the policy does not handle).

Provide a list of related PRs (if any)

@azure-sdk
Copy link
Collaborator

azure-sdk commented Sep 17, 2024

API change check

API changes are not detected in this pull request.

@timovv timovv marked this pull request as draft September 17, 2024 21:17
@timovv timovv marked this pull request as ready for review September 25, 2024 21:03
@timovv timovv requested review from bterlson and a team as code owners September 25, 2024 21:03
Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

Few questions / comments but looking great!

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for getting this through the finish line!

@timovv timovv merged commit dbc12ec into Azure:main Oct 8, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants