-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Handle client certificate rotation for token binding #53916
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
Handle client certificate rotation for token binding #53916
Conversation
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 implements support for client certificate rotation in the Azure.Core transport layer to enable dynamic token binding scenarios. The changes allow transport instances to be updated with new certificate configurations at runtime without requiring full pipeline reconstruction.
Key Changes:
- Added
UpdateTransportmethod toHttpPipelineTransportbase class and implementations inHttpClientTransportandHttpWebRequestTransport - Introduced
ISupportsTransportCertificateUpdateinterface for policies that need to trigger transport updates - Extended
AccessTokenwith aBindingCertificateproperty for Proof of Possession (PoP) scenarios - Added comprehensive test coverage for certificate rotation scenarios (rotating from empty, rotating from existing cert)
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/core/Azure.Core/src/Pipeline/Internal/ISupportsTransportUpdate.cs |
New internal interface for policies that support transport certificate updates via event subscription |
sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs |
Added virtual UpdateTransport method to base transport class with default NotSupportedException |
sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs |
Implemented UpdateTransport with support for client and handler factories, using volatile field and Interlocked for thread-safety |
sdk/core/Azure.Core/src/Pipeline/HttpWebRequestTransport.cs |
Implemented UpdateTransport using Interlocked.Exchange for thread-safe configuration updates |
sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs |
Added subscription to ISupportsTransportCertificateUpdate events in constructors to enable transport updates |
sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransportOptions.cs |
Added internal Clone method for creating copies of transport options during updates |
sdk/core/Azure.Core/src/AccessToken.cs |
Added BindingCertificate property and constructor overload to support token binding with client certificates |
sdk/core/Azure.Core/tests/TransportFunctionalTests.cs |
Added two new test methods for certificate rotation scenarios plus code formatting improvements |
sdk/core/Azure.Core/tests/PipelineTestBase.cs |
Extracted GetCertificate helper method and added second test certificate constant (Pfx2) |
sdk/core/Azure.Core/tests/HttpPipelineTests.cs |
Added test for transport update mechanism with TransportUpdatingPolicy test class |
sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTest.cs |
Removed unused certCallback field |
sdk/core/Azure.Core.TestFramework/src/MockTransport.cs |
Implemented UpdateTransport to track transport updates in tests |
sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj |
Changed from PackageReference to ProjectReference for Azure.Core (likely temporary for testing) |
sdk/core/Azure.Core/api/*.cs |
Updated API surface files for all target frameworks with new public constructors and methods |
sdk/core/Azure.Core/src/Pipeline/Internal/ISupportsTransportUpdate.cs
Outdated
Show resolved
Hide resolved
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.