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

Enforce rate limit per token #33

Merged
merged 3 commits into from
Jun 29, 2021
Merged

Conversation

sbs2001
Copy link
Contributor

@sbs2001 sbs2001 commented Jun 29, 2021

  1. Create counter per token.
  2. Increment the counter per api call, if it exceeds the rate limit of 4 req per second, delay.
  3. Every one 1 second reset counter.

sbs2001 added 2 commits June 29, 2021 16:39
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
main.go Outdated Show resolved Hide resolved
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
@sbs2001 sbs2001 merged commit ed2d540 into crowdsecurity:main Jun 29, 2021
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

Successfully merging this pull request may close these issues.

2 participants