Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,763
    • Issues 44,763
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #344807
Closed
Open
Issue created Nov 03, 2021 by Markus Koller@toupeira🌴Contributor

Add custom handling for frontend requests in API rate limiting

Problem to solve

API requests coming from the GitLab frontend are treated the same as other API requests, and so will have the same rate limiting applied.

This is problematic because we want the ability to apply stricter API rate limits without impacting normal app usage, especially for the new rate limit for unauthenticated API requests.

Proposal

We could reuse the CSRF token for this, which is already generated for every request and made available to the frontend.

In the backend we could verify the token and treat a request as "privileged", and either disable rate-limiting or apply custom thresholds/behaviour.

Involved components

  • lib/gitlab/throttle.rb
  • lib/gitlab/rack_attack.rb
  • lib/gitlab/rack_attack/request.rb
Assignee
Assign to
Time tracking