-
Notifications
You must be signed in to change notification settings - Fork 25k
WN 11 P1: IOutputCachePolicyProvider, TimeProvider, Auto-trust #36760
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
aspnetcore/release-notes/aspnetcore-11/includes/development-certificate-trust.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ### Auto-trust development certificates in WSL | ||
|
|
||
| The development certificate setup now automatically trusts certificates in WSL (Windows Subsystem for Linux) environments. When you run `dotnet dev-certs https --trust` in WSL, the certificate is automatically installed and trusted in both the WSL environment and Windows, eliminating manual trust configuration. | ||
wadepickett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| # Automatically trusts certificates in both WSL and Windows | ||
| dotnet dev-certs https --trust | ||
| ``` | ||
|
|
||
| This improvement streamlines the development experience when using WSL, removing a common friction point for developers working in Linux environments on Windows. | ||
|
|
||
| Thank you [@StickFun](https://github.com/StickFun) for this contribution! | ||
18 changes: 18 additions & 0 deletions
18
aspnetcore/release-notes/aspnetcore-11/includes/identity-time-provider.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ### `TimeProvider` support in ASP.NET Core Identity | ||
|
|
||
| ASP.NET Core Identity now uses `TimeProvider` instead of `DateTime` and `DateTimeOffset` for all time-related operations. This change makes Identity components more testable and provides better control over time in tests and specialized scenarios. | ||
|
|
||
| The following example shows how to use a fake `TimeProvider` for testing Identity features: | ||
|
|
||
| ```csharp | ||
| // In tests | ||
| var fakeTimeProvider = new FakeTimeProvider( | ||
| new DateTimeOffset(2024, 1, 1, 0, 0, 0, TimeSpan.Zero)); | ||
|
|
||
| services.AddSingleton<TimeProvider>(fakeTimeProvider); | ||
wadepickett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| services.AddIdentity<IdentityUser, IdentityRole>(); | ||
|
|
||
| // Identity will now use the fake time provider | ||
| ``` | ||
|
|
||
| By using `TimeProvider`, you can more easily write deterministic tests for time-sensitive Identity features such as token expiration, lockout durations, and security stamp validation. | ||
20 changes: 20 additions & 0 deletions
20
aspnetcore/release-notes/aspnetcore-11/includes/output-cache-policy-provider.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ### `IOutputCachePolicyProvider` interface | ||
|
|
||
| ASP.NET Core in .NET 11 provides the [IOutputCachePolicyProvider](https://source.dot.net/#Microsoft.AspNetCore.OutputCaching/[IOutputCachePolicyProvider.cs](https://source.dot.net/#Microsoft.AspNetCore.OutputCaching/IOutputCachePolicyProvider.cs)` interface for implementing custom output caching policy selection logic. By using this interface, apps can determine the default base caching policy, check for the existence of named policies, and support advanced scenarios where policies must be resolved dynamically. Examples include loading policies from external configuration sources, databases, or applying tenant-specific caching rules. | ||
|
|
||
| The following code shows the `IOutputCachePolicyProvider` interface: | ||
|
|
||
| ```csharp | ||
| public interface IOutputCachePolicyProvider | ||
| { | ||
| IReadOnlyList<IOutputCachePolicy> GetBasePolicies(); | ||
| ValueTask<IOutputCachePolicy?> GetPolicyAsync(string policyName); | ||
| } | ||
| ``` | ||
|
|
||
| <!-- | ||
| UPDATE 11.0 - Add API cross-reference link when available: | ||
| <xref:Microsoft.AspNetCore.OutputCaching.IOutputCachePolicyProvider> | ||
| --> | ||
|
|
||
| Thank you [@lqlive](https://github.com/lqlive) for this contribution! |
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.
Uh oh!
There was an error while loading. Please reload this page.