Skip to content
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

FR: Multiple rate limits #30

Open
spicemix opened this issue May 21, 2021 · 0 comments
Open

FR: Multiple rate limits #30

spicemix opened this issue May 21, 2021 · 0 comments

Comments

@spicemix
Copy link

Thanks so much for this useful tool!

I would like to use say 2 accesses per 15 seconds limit as you have in the example code, plus a 250 accesses per 24 hours limit as well. That would hinder faster DOS-style abuse and slower scraper-style abuse as well, while still enabling normal human use.

What would be the best way to do this? I could create two limiters and use the same user key, but if I do that, should it be a limit of 2x250 (ie 500) because the accesses will be recorded twice on that key? I probably don't want to double up on keys and double my storage cost instead. Maybe you know a better way.

This example shows what a more advanced usage scenario would be, although the code isn't as refined as your library.

Also btw is there any way of limiting how many user accounts an IP address can create in a hour? There's a disabled flag on the account, and theres the onCreate trigger from firebase auth...but I don't see that it offers access to the ip address for me to use a limiter keyed on that...and I'd rather not use the REST API for auth.

Thanks for your assistance on this! Great work on this, code is exemplary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant