stefanprodan / AspNetCoreRateLimit

ASP.NET Core rate limiting middleware
MIT License
3.12k stars 445 forks source link

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

Open cristipufu opened 2 years ago

cristipufu commented 2 years ago

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

andygarratt commented 1 year ago

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

SteveDurkee commented 1 year ago

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.

iXab3r commented 1 year ago

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

vmandic commented 1 year ago

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"));

muhammadganji commented 1 year ago

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

Deali-Axy commented 5 months ago

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

pampua84 commented 5 months ago

Hi everyone, I’ve encountered an issue with the new .NET 7/8 rate limiter: it lacks several features from the previous version, including the rate limiter for ClientId. What are your thoughts? Should we attempt to integrate the old features into the new repository, or is it better to continue using the current one, considering they offer distinct approaches to rate limiting?

Deali-Axy commented 4 weeks ago

I would suggest to keep using the current features, Microsoft is always slow to move officially, still no need to integrate the old features into the new repository, right?