Skip to content

Add issuable searches to search rate limit

Heinrich Lee Yu requested to merge 340836-rate-limit-issuable-searches into master

What does this MR do and why?

Rate limits issuable searches so that we can re-enable searching made by anonymous users. This uses the existing search rate limit settings.

This is behind a feature flag rate_limit_issuable_searches.

Note: I also considered rate limiting at the finder level, but I think there may be other places that use the finder but we don't want to include in the limit. For example, in the recent issues autocomplete finder, it adds a scope with a list of issue IDs so the searches here are fast and we do not need to limit them.

Related to #340836

How to set up and validate locally

  1. Enable rate_limit_issuable_searches
  2. (Optional) Lower the search rate limit in Admin > Settings > Network > Search rate limits
  3. Load a page like http://127.0.0.1:3000/dashboard/issues?scope=all&state=opened&search=test many times to go over the limit
  4. Get a 429 response

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports

Loading