-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Address API review feedback for what was IApiEndpointMetadata #63283
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
Conversation
- We've now added IDisableCookieRedirectMetadata, IAllowCookieRedirectMetadata and corresponding extension methods - We only added one attribute, [AllowCookieRedirect] for now, since [ApiController] adds IDisableCookieRedirectMetadata already - Add's an AppContext swithc to revert to the old behavior and ignore metadata called "Microsoft.AspNetCore.Authentication.Cookies.IgnoreRedirectMetadata"
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 addresses API review feedback by replacing the previous IApiEndpointMetadata
interface with more specific cookie redirect metadata interfaces. The changes introduce IDisableCookieRedirectMetadata
and IAllowCookieRedirectMetadata
to provide fine-grained control over cookie-based authentication redirect behavior, along with an AppContext switch for backward compatibility.
- Replaces
IApiEndpointMetadata
withIDisableCookieRedirectMetadata
throughout the codebase - Adds
IAllowCookieRedirectMetadata
to override disable behavior when needed - Introduces
AllowCookieRedirectAttribute
and extension methods for easy configuration - Adds AppContext switch "Microsoft.AspNetCore.Authentication.Cookies.IgnoreRedirectMetadata" to revert to old behavior
Reviewed Changes
Copilot reviewed 114 out of 114 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/Http/Http.Abstractions/src/Metadata/IApiEndpointMetadata.cs | Removed old interface |
src/Http/Http.Abstractions/src/Metadata/IDisableCookieRedirectMetadata.cs | New interface for disabling cookie redirects |
src/Http/Http.Abstractions/src/Metadata/IAllowCookieRedirectMetadata.cs | New interface for allowing cookie redirects |
src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs | Updated logic to use new metadata interfaces with AppContext switch |
src/Http/Http.Extensions/src/CookieRedirectEndpointConventionBuilderExtensions.cs | New extension methods for configuring redirect behavior |
src/Http/Http.Extensions/src/AllowCookieRedirectAttribute.cs | New attribute implementing IAllowCookieRedirectMetadata |
Multiple test files | Updated test assertions to use new interface names |
Multiple source files | Replaced ApiEndpointMetadata.Instance with DisableCookieRedirectMetadata.Instance |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
src/Http/Http.Extensions/test/CookieRedirectEndpointConventionBuilderExtensionsTests.cs
Outdated
Show resolved
Hide resolved
src/Http/Http.Extensions/test/CookieRedirectEndpointConventionBuilderExtensionsTests.cs
Outdated
Show resolved
Hide resolved
* Avoid race that can cause Kestrel's RequestAborted to not fire (#62385) * Send Keep-Alive Ping Immediately When Previous Ping Is Overdue (#63195) * Make new validations consistent with System.ComponentModel.DataAnnotations behavior (#63231) * Add support for type-level validation attributes, update validation ordering * Code review fix, test fix * Fix trimming annotation * Fix trimming annotation * Separate caches for property and type attributes * Fix typo Co-authored-by: Brennan <[email protected]> * Fix typo Co-authored-by: Brennan <[email protected]> * Fix and simplify the emitted code * Update src/Validation/test/Microsoft.Extensions.Validation.GeneratorTests/ValidationsGeneratorTestBase.cs --------- Co-authored-by: Brennan <[email protected]> Co-authored-by: Safia Abdalla <[email protected]> * Search for slnx files when setting solution-relative content root (#61305) * Address API review feedback for what was IApiEndpointMetadata (#63283) --------- Co-authored-by: Stephen Halter <[email protected]> Co-authored-by: Reagan Yuan <[email protected]> Co-authored-by: Ondřej Roztočil <[email protected]> Co-authored-by: Brennan <[email protected]> Co-authored-by: Safia Abdalla <[email protected]> Co-authored-by: Jacob Bundgaard <[email protected]>
Fixes #62883