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

add ratelimit flag #123

Merged
merged 6 commits into from
Jul 24, 2023
Merged

Conversation

dogancanbakir
Copy link
Member

Closes #122.

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a 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

ratelimit_var.go Outdated Show resolved Hide resolved
ratelimit_var.go Outdated Show resolved Hide resolved
ratelimit_var.go Outdated Show resolved Hide resolved
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a 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

Copy link
Member

@Mzack9999 Mzack9999 left a 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?

@dogancanbakir dogancanbakir mentioned this pull request Jul 24, 2023
@dogancanbakir
Copy link
Member Author

@Mzack9999 Make sense. I opened an issue to track it #125. Feel free to edit/update.

@ehsandeep ehsandeep merged commit dbf9da1 into projectdiscovery:main Jul 24, 2023
3 checks passed
@ehsandeep ehsandeep added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RateLimit flag
4 participants