Repository navigation
Add per-certificate mTLS HTTP client factory - #671
Open
Robbie-Microsoft wants to merge 6 commits into
Open
Robbie-Microsoft wants to merge 6 commits into
Robbie-Microsoft wants to merge 6 commits into
Conversation
Robbie-Microsoft
changed the base branch from
robbie-microsoft-prepare-661-after-669
to
rginsburg/mtls-pop-feature
September 17, 2026 21:18
Robbie-Microsoft
force-pushed
the
robbie-microsoft-per-certificate-mtls-factory
branch
from
September 17, 2026 21:18
2fcbd46 to
0da7e13
Compare
|
Robbie-Microsoft
force-pushed
the
robbie-microsoft-per-certificate-mtls-factory
branch
2 times, most recently
from
September 17, 2026 21:35
39a5818 to
fa2a45e
Compare
Expose HTTPClient and MtlsHTTPClientFactory through WithHTTPClient so adapters can build middleware-backed clients around an MSAL-owned, certificate-snapshot augmenter that installs the certificate and security policy. Reuse comm.Client's per-certificate cache so the same certificate shares a client while different certificates isolate transports, pools, and TLS sessions. Validate synchronous factory augmentation, fail closed on invalid callback behavior or transports, and close discarded, replaced, and publication-race clients safely. Preserve the direct *http.Client path, redirect protection, generation fencing, and idle cleanup. Include the review fixes for typed-nil transports, deterministic same-certificate publication-race coverage, and precise factory and example documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Robbie-Microsoft
force-pushed
the
robbie-microsoft-per-certificate-mtls-factory
branch
from
September 18, 2026 22:18
6b33d61 to
3de35ec
Compare
|
Reuse the released ClientConfigurer contract for fresh certificate-scoped adapters while preserving MSAL-owned transport augmentation, cache isolation, and cleanup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the finalized PR 661 branch while preserving the consolidated ClientConfigurer factory API and full-SHA workflow pins. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the finalized PR 661 branch with its workflow pin removal while preserving the consolidated ClientConfigurer factory API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the approved MissingClientCertificate assertion update from PR 661 while preserving the consolidated ClientConfigurer factory delta. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the finalized PR 661 workflow pins while preserving the Graph compatibility marker and consolidated ClientConfigurer factory delta. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Joel Hendrix (jhendrixMSFT)
approved these changes
Oct 22, 2026
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.



Summary
Adds per-certificate mTLS client construction for HTTP adapters that own middleware. #669's one-time Service Fabric use of
managedidentity.ClientConfigurerremains unchanged. Confidential clients use the same released configuration contract on fresh adapters because certificates can rotate or be selected concurrently.API and behavior
confidential.HTTPClient,confidential.ClientConfigurer, andconfidential.MtlsHTTPClientFactorycontracts.confidential.ClientConfigureraliases the releasedmanagedidentity.ClientConfigurer; the factory capability is detected on the value passed toconfidential.WithHTTPClient.NewMtlsClient() (ClientConfigurer, error)returns a fresh, independently configurable adapter. MSAL calls itsConfigureClientmethod with an augmenter closed over the selected certificate snapshot. The original factory, shared client, and shared transport are not mutated.*http.Clientpath is unchanged. Generation fencing, cache-capacity cleanup, redirect refusal and override behavior, and idle-connection cleanup remain in place.Contract
*http.Client; rejects missing, repeated, or late calls; and propagates factory,ConfigureClient, and augmenter errors.Doterminates through the augmented client andCloseIdleConnectionsreaches its connection pool. MSAL cannot inspect arbitrary middleware to verify those obligations.*http.Transportis rejected before request transmission.Scope and validation