Add rate limiter context HttpContext feature#45652
Add rate limiter context HttpContext feature#45652MadL1me wants to merge 1 commit intodotnet:mainfrom
Conversation
|
Thanks for your PR, @MadL1me. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
|
||
| namespace Microsoft.AspNetCore.RateLimiting.Features; | ||
|
|
||
| public interface IRateLimiterContextFeature |
There was a problem hiding this comment.
Note: there is no xml docs, cause i'm not sure about the API
There was a problem hiding this comment.
New APIs need to be approved. This needs an API proposal.
There was a problem hiding this comment.
The new APIs also need to be added to https://github.com/dotnet/aspnetcore/blob/main/src/Middleware/RateLimiting/src/PublicAPI.Unshipped.txt. There's a suggestion hint in VS to do this for you.
|
I think this PR is in @wtgodbe area |
|
Hi @MadL1me. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Add rate limiter context HttpContext feature
Added HttpContext feature which has access to Global and Endpoint limiters with availability to fetch rate limiters statistics and get Lease metadata. Based on #44140
Description
Motivation
In #44140 issue, one of The dream scenario for a better ASP.NET Core rate limiter middleware as @maartenba says, would be able Have a feature on the current HttpContext that gives access to the current rate limit context, so these details can also be returned on successful requests, or added to telemetry.. This PR addresses this concern.
I thought it would be much better to make multiple atomic, but feature-complete PR's to one issue, so it would be faster and easier to review