Skip to content

Add throttling configuration for Files API endpoints

What does this MR do and why?

Contributes to #338903 (closed)

It removes files_api_throttling feature flag and allows to throttle Files API endpoints.

Screenshots or screen recordings

Screenshot_2021-12-08_at_12.15.42

How to set up and validate locally

  1. Go to Admin Area -> Network: http://<gdk_url>/admin/application_settings/network
  2. Enable a restrictive rate-limit for Files API and save changes. For example, 2 authorized requests per 15 seconds Screenshot_2021-09-06_at_16.07.26
  3. Restart GDK to apply the rate-limit (gdk restart rails-web)
  4. Make consecutive requests to Files API (for example, http://<gdk_url>/api/v4/projects/4/repository/files/README?ref=master)
  5. Verify that API returns 429 page when rate-limit reached Screenshot_2021-09-06_at_16.11.13

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 Vasilii Iakliushin

Merge request reports

Loading