Add Users AllowList to Git abuse rate limit settings
What does this MR do and why?
Resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/17
- Adds an
Excluded Usersinput to theGit abuse rate limitsettings form. This input will let admin configure an allowlist of users who will not be banned even if they exceed the set git rate limits. - The maximum number of users an admin can add to this allowlist is a 100.
- In the database, this allowlist will be stored as an array of usernames in the
application_settingstable in columngit_rate_limit_users_allowlist. This is because downstream, we will use the ApplicationRateLimiter to enforce these limits. -
git_rate_limit_users_allowlistwill be exposed as part of the/application/settingsAPI endpoint - Since, the allowlist is a dynamic component, this MR also refactors the existing
Git abuse rate limitsettings form HAML to Vue. Subsequently, feature specs + view specs + API specs are all updated.
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag
git_abuse_rate_limit_feature_flag:echo "Feature.enable(:git_abuse_rate_limit_feature_flag)" | rails c - Sign in as admin
- Navigate to
http://localhost:3000/admin/application_settings/reporting
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 Hinam Mehra