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.

Increase blockDuration on next failed attempt

See original GitHub issue

Hello, great library btw. I just wanna if it is possible to increase the blockDuration dynamically on succeeding failures?

Given this config

const loginLimiter = new RateLimiterRedis({
  redis: redisClient,
  keyPrefix: 'login:',
  points: 5, // 5 attempts
  duration: 60 * 60 * 24, // within a day
  blockDuration: 60, // 1 min
});

I want to set the next blockDuration to 5mins if the next rate limit reset was already consumed.

Just to illustrate:

5 attempts > fail > wait for 1 min > 1 min has passed > 5 attempts > fail > wait for 5mins

Is it possible for this library?

Thanks for the help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jhnferrariscommented, Mar 19, 2019

@animir Hello Roman. I had the chance to try out your fibonacci block behavior. It works pretty well. Thanks dude!

0reactions
jhnferrariscommented, Mar 17, 2019

Hello @animir, I haven’t gotten back on it yet. Thanks for the wiki. I’ll check this out.

Closing this ticket since you provided some direction. Cheers dude!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overall example · animir/node-rate-limiter-flexible Wiki - GitHub
Well known authorisation protection technique is increasing block duration on consecutive failed attempts. Here is the logic: maximum 5 fails per 15 minutes....
Read more >
Technical Tip: How to limit SSL VPN login attempts...
Description The article describes how to alter the default login-attempt-limit and login-block-time for SSL VPN users. Solution
Read more >
User Security Configuration Guide - Cisco IOS Login ...
Denying logins from all sources. The following sample output from show login failures command shows all failed login attempts on the router:
Read more >
I received an error message saying, “You've reached the ...
I received an error message saying, “You've reached the maximum logon attempts. Exit your browser and try again.” What do I do?
Read more >
Mono (reactor-core 3.5.1)
Subscribe to this Mono and block indefinitely until a next signal is received. ... Add behavior triggered when the Mono emits an item,...
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