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
How to set up and validate locally
- Go to Admin Area -> Network: http://<gdk_url>/admin/application_settings/network
- Enable a restrictive rate-limit for Files API and save changes. For example, 2 authorized requests per 15 seconds
- Restart GDK to apply the rate-limit (
gdk restart rails-web
) - Make consecutive requests to Files API (for example,
http://<gdk_url>/api/v4/projects/4/repository/files/README?ref=master
) - Verify that API returns 429 page when rate-limit reached
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin