question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

4.0 Breaking Change Wiki out of date

See original GitHub issue

I guess I got lucky and updated my project references first and had to wade through the test code to find out what was missing… I have no clue how to submit pull request for a wiki, LOL.

Might want a 4.0 breaking changes document along with 3.0 breaking changes.

Wiki examples needs updated to show (this is missing):

// register stores
services.AddInMemoryRateLimiting();
// OR
// services.AddDistributedRateLimiting<AsyncKeyLockProcessingStrategy>();

The two pages: https://github.com/stefanprodan/AspNetCoreRateLimit/wiki/ClientRateLimitMiddleware#setup https://github.com/stefanprodan/AspNetCoreRateLimit/wiki/IpRateLimitMiddleware

Thanks for the great package!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:8

github_iconTop GitHub Comments

3reactions
deivyd321commented, Aug 6, 2021

Until there are no official docs, can someone share a working example of Client rate limiting using Redis?

services.Configure<IpRateLimitOptions>(Configuration.GetSection("IpRateLimiting"));
services.Configure<IpRateLimitPolicies>(Configuration.GetSection("IpRateLimitPolicies"));

//load general configuration from appsettings.json
services.Configure<ClientRateLimitOptions>(Configuration.GetSection("ClientRateLimiting"));
services.Configure<ClientRateLimitPolicies>(Configuration.GetSection("ClientRateLimitPolicies"));

services.AddDistributedRateLimiting<AsyncKeyLockProcessingStrategy>();
services.AddDistributedRateLimiting<RedisProcessingStrategy>();
services.AddSingleton<IIpPolicyStore, DistributedCacheIpPolicyStore>();
services.AddSingleton<IRateLimitCounterStore, DistributedCacheRateLimitCounterStore>();

var redisOptions = ConfigurationOptions.Parse(Configuration["ConnectionStrings:Redis"]);
services.AddSingleton<IConnectionMultiplexer>(provider => ConnectionMultiplexer.Connect(redisOptions));
services.AddRedisRateLimiting();

services.AddSingleton<IRateLimitConfiguration, CustomRateLimitConfiguration>();

I am getting this error: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: AspNetCoreRateLimit.IIpPolicyStore Lifetime: Singleton ImplementationType: AspNetCoreRateLimit.DistributedCacheIpPolicyStore

Current documentation is confusing version v3 vs v4

0reactions
hedronncommented, Jan 24, 2023

@madebyluque This is the implementation I have for my .NET 6 API using IP Rate Limiting with Azure Redis Cache. I have not tested this in a load balancer setup as yet, only a single server development environment. But if this works for you in a cluster environment I would be grateful for the confirmation.

[Nuget Packages]

AspNetCoreRateLimit 5.0.0 StackExchange.Redis 2.2.4

[Startup.cs]

public void ConfigureServices(IServiceCollection services) { …

services.AddDistributedRateLimiting<AsyncKeyLockProcessingStrategy>(); services.AddStackExchangeRedisCache(option => { option.Configuration = Configuration[“RedisCache:ConnectionString”]; option.InstanceName = “RedisCacheInstanceName”; });

services.Configure<IpRateLimitOptions>(Configuration.GetSection(“IpRateLimiting”)); services.Configure<IpRateLimitPolicies>(Configuration.GetSection(“IpRateLimitPolicies”));

services.AddSingleton<IIpPolicyStore, DistributedCacheIpPolicyStore>(); services.AddSingleton<IRateLimitCounterStore, DistributedCacheRateLimitCounterStore>(); services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();

… }

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { …

app.UseIpRateLimiting();

… }

---------- Throttled Response -------- Error: response status is 429

{ “message”: “Status code: 429”, “details”: “API call quota exceeded” }

Hope this helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android version history
Changes include the ones listed below. Version, Release date, Features, Image(s). 2.0, October 27, 2009.
Read more >
History for API Breaking Changes · microsoft/TypeScript Wiki
History for API Breaking Changes · microsoft/TypeScript Wiki. ... Revisions. Compare revisions. Fix date typo ... DanielRosenwasser committed on May 4, 2022.
Read more >
Release Notes - Identity Provider 4 - Confluence - Atlassian
The fix needed for this is documented below under V4.1.0 under Breaking Changes → Deployment Descriptor Issue. https://shibboleth.atlassian.net/browse/IDP- ...
Read more >
Version History - Binding of Isaac: Rebirth Wiki - Fandom
The game is occasionally updated by Nicalis (the developers). These pages will attempt to track all of the changes, which are often undocumented....
Read more >
Version History
Stardew Valley was released on 26 February 2016 for Windows PC after almost four years of closed development. Linux and macOS compatibility was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found