Repository navigation
Clarify that the certificate validation cache is safely scoped per scheme - #68621
Merged
JanKrivanek merged 2 commits intoAug 24, 2026
Merged
JanKrivanek merged 2 commits into
JanKrivanek merged 2 commits into
Conversation
JanKrivanek
marked this pull request as ready for review
August 18, 2026 16:03
JanKrivanek
requested review from
Youssef1313,
cincuranet,
halter73 and
rokonec
as code owners
August 18, 2026 16:03
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies (via inline comments) that CertificateValidationCache is safe to use as a singleton across multiple certificate authentication schemes because cache keys are scoped by scheme name.
Changes:
- Add an explanatory comment in
CertificateValidationCache.ComputeKeyabout scheme-name namespacing of cache entries. - Add an explanatory comment at
AddCertificateCachewhere the cache is registered as a singleton.
Show a summary per file
| File | Description |
|---|---|
| src/Security/Authentication/Certificate/src/CertificateValidationCache.cs | Adds a comment explaining how the cache key is namespaced by scheme name. |
| src/Security/Authentication/Certificate/src/CertificateAuthenticationExtensions.cs | Adds a comment explaining why the singleton registration is safe across schemes. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
rokonec
approved these changes
Aug 18, 2026
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
JanKrivanek
enabled auto-merge
August 19, 2026 11:14
JanKrivanek
disabled auto-merge
August 19, 2026 11:15
JanKrivanek
enabled auto-merge (squash)
August 19, 2026 11:15
cincuranet
approved these changes
Aug 24, 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.
Context
CertificateValidationCache is registered once as an app-wide singleton via AddCertificateCache(), which can look surprising at a glance since multiple certificate authentication schemes may share the same instance. This PR adds inline comments at the cache-key computation and at the singleton registration spelling out the intended behavior: ComputeKey already namespaces every entry by authentication scheme name before the certificate thumbprint, so sharing one cache instance across schemes is by design.
Change
Comment-only change in CertificateValidationCache.ComputeKey and CertificateAuthenticationExtensions.AddCertificateCache; no behavior change.