-
Notifications
You must be signed in to change notification settings - Fork 17
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
add ratelimit flag #123
add ratelimit flag #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation LGTM !
$ ./basic -rls "h1=8/s"
{"h1"="1s"}
suggesting some minor changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm !
$ go run . -rls "hackerone.com=8/1s,chaos.projectdiscovery.io=60/m"
Got RateLimits: {"hackerone.com":"8/1s","chaos.projectdiscovery.io":"60/1m0s"}
- just realised that time unit validation can be bypassed (ex: 1000m) so replaced with MaxRateLimitTime
- adds example usage in examples/basic/main.go file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
We will need to find an easy way for the app using goflags to specify also a list of accepted keys that we will use for validation at runtime (similarly to enum) to avoid user typos (especially for long names). Maybe shall we track this in a follow up ticket?
@Mzack9999 Make sense. I opened an issue to track it #125. Feel free to edit/update. |
Closes #122.