-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Implement minimal RateLimitingMiddleware #41008
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
_onRejected = options.Value.OnRejected; | ||
} | ||
|
||
// TODO - EventSource? |
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.
Could be valuable to add EventSource logging to this, part of the next pass?
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.
I'm fine with waiting for the next pass. It might be better to add EventSource logging to the rate limiter implemenations, but that might be too low level to be useful if there are many.
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.
Is there an issue tracking this yet?
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.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
src/Middleware/RateLimiting/src/Microsoft.AspNetCore.RateLimiting.csproj
Outdated
Show resolved
Hide resolved
src/Middleware/RateLimiting/src/Microsoft.AspNetCore.RateLimiting.csproj
Show resolved
Hide resolved
src/Middleware/RateLimiting/test/RateLimitingMiddlewareTests.cs
Outdated
Show resolved
Hide resolved
@BrennanConroy @Tratcher @halter73 @davidfowl updated to reflect feedback from API review, and added a couple tests. After changing Going to add a sample though that might not make it for preview4 |
Bare bones implementation of #37384. The only scenario currently supported is the user giving us a custom configured
PartitionedRateLimiter<HttpContext>
, which we let do its thing. No endpoint awareness or piecemeal limiter construction is supported yet, that will be in the next pass (Right now if the user wants endpoint awareness, they must build it in to their PartitionedRateLimiter implementation). I have another branch with skeletons for that stuff (which I've deleted from this one) here: https://github.com/wtgodbe/aspnetcore/tree/wtgodbe/RateLimitMid.Also still need to work out how we support net6 & net7 with this, which will come in the next pass.
Also todo - add a sample