-
Notifications
You must be signed in to change notification settings - Fork 842
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
Added support for AspNetCore 7 rate limiting #1967
Conversation
Is there an issue tracking that in AspNetCore? |
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.
Very nice
Co-authored-by: Chris Ross <[email protected]>
Co-authored-by: Arvin Kahbazi <[email protected]>
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.
Thanks!
src/ReverseProxy/Configuration/IYarpRateLimiterPolicyProvider.cs
Outdated
Show resolved
Hide resolved
src/ReverseProxy/Configuration/IYarpRateLimiterPolicyProvider.cs
Outdated
Show resolved
Hide resolved
src/ReverseProxy/Configuration/IYarpRateLimiterPolicyProvider.cs
Outdated
Show resolved
Hide resolved
test/ReverseProxy.Tests/Configuration/YarpRateLimiterPolicyProviderTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Miha Zupan <[email protected]>
@mburumaxwell I pushed some fixes to your branch so we can get this into the upcoming preview release. Thanks for helping out. |
Okay. Looking forward. Should the same workflow be used for output caching? (Also introduced in .NET7) |
Add support for Rate Limiting available from AspNetCore 7.0.
Caveats:
#if NET7_0_OR_GREATER
which can potentially be a problem for maintenance.IAuthorizationPolicyProvider
orICorsPolicyProvider
. TheRateLimitingMiddleware
usesRateLimiterOptions.PolicyMap
but it is internal. Hopefully something will be available in AspNetCore 8 to allow validation. ATODO
exists in the validation just tracking and as a reminder.default
similar toAuthorizationPolicy
andCorsPolicy
because theEnableRateLimitingAttribute
requires apolicyName
. Default policy would have to be configured in the serivces setup:services.AddRateLimiter(options => { /* conf stuff here */ });
Fixes: #1776