Skip to content

L2 cache bypass#3444

Merged
westin-m merged 17 commits into
devfrom
westin/cache-bypass
Apr 24, 2026
Merged

L2 cache bypass#3444
westin-m merged 17 commits into
devfrom
westin/cache-bypass

Conversation

@westin-m

@westin-m westin-m commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Addresses Bug 3542293: RequestRefresh not bypassing L2 Cache

Introduce a new interface that provides context to the event handler implementation, allowing it to optionally bypass a cache lookup.

This will need to be merged and released before the corresponding MISE fix can be merged.

Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
@westin-m westin-m marked this pull request as ready for review April 14, 2026 22:13
@westin-m westin-m requested a review from a team as a code owner April 14, 2026 22:13
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a context-aware configuration event handler API so ConfigurationManager can signal when a retrieval was triggered by RequestRefresh, enabling handlers to bypass a cache lookup (per Bug 3542293).

Changes:

  • Introduces ConfigurationRetrievalContext and IConfigurationEventHandlerContextAware<T> to pass retrieval context (including BypassCache) into event handlers.
  • Updates ConfigurationManager (blocking + non-blocking paths) to pass context into BeforeRetrieveAsync, preferring the context-aware overload when implemented.
  • Adds OpenIdConnect test coverage and a context-aware mock event handler validating BypassCache behavior across first retrieval, automatic refresh, and RequestRefresh.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/MockConfigurationEventHandlerContextAware.cs Adds a context-aware test double implementing the new handler interface.
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerEventHandlerContextAwareTests.cs Adds tests validating context-aware handler selection and BypassCache semantics.
src/Microsoft.IdentityModel.Protocols/PublicAPI.Unshipped.txt Records newly introduced public surface area for API validation.
src/Microsoft.IdentityModel.Protocols/GlobalSuppressions.cs Updates suppression target signature for the updated HandleBeforeRetrieveAsync method.
src/Microsoft.IdentityModel.Protocols/Configuration/IConfigurationEventHandlerContextAware.cs Defines the new context-aware configuration event handler interface.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationRetrievalContext.cs Defines the context object carrying the BypassCache signal.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager_Blocking.cs Passes BypassCache to the handler in blocking mode based on refresh request state.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Wires context into handler calls and attempts to propagate bypass behavior into background refresh flows.

Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
westin-m and others added 3 commits April 17, 2026 10:39
…figurationManagerEventHandlerContextAwareTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ionManager.cs

Co-authored-by: Peter <34331512+pmaytak@users.noreply.github.com>
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
Comment thread src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Outdated
add after to context aware interface

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.IdentityModel.Protocols/PublicAPI.Unshipped.txt
@westin-m westin-m requested a review from pmaytak April 20, 2026 18:45
This was referenced Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants