stefanprodan / AspNetCoreRateLimit

ASP.NET Core rate limiting middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Built-in Rate Limiting support - part of .NET 7

cristipufu opened this issue · comments

If you haven't heard yet, .NET 7 comes with built-in support for Rate Limiting (in-memory): https://devblogs.microsoft.com/dotnet/announcing-rate-limiting-for-dotnet/

I have created another repository for multi-node deployments (with Redis) and my future contributions will be focused on this new library: https://github.com/cristipufu/aspnetcore-redis-rate-limiting

I believe the built in support is overall and not per IP?

I believe the built in support is overall and not per IP?

This can be accomplished using the PartitionedRateLimiter. Using the built in PartitionedRateLimiter.Create method and defining a partition per IP.

It could only be applied on Global level.
For endpoints there is an open issue dotnet/aspnetcore#42691
Seems strange that such a basic scenario (multiple different rules for a single endpoint) is not supported by default.

Any migration guidelines on how to switch over with Redis support from this nuget to new one?

EDIT: I am using app.UseIpRateLimiting(); and huge appsettings conf: services.Configure<IpRateLimitOptions>(Configuration.GetSection("IpRateLimiting"));

there is any way to implement RateLimit Based on IP v6 in .net7 ?
I can't find out the document of Microsoft, it's complex

So far (.net8) Microsoft.AspNetCore.RateLimiting is not good, although it is built-in, but not as good as AspNetCoreRateLimit out of the box