diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-24 22:49:31 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-24 22:49:31 +0300 |
commit | 3cefc5d7df09dbc21cd9c892bc6c62b5b583ca6a (patch) | |
tree | 2e996ca71e4e16c74f1be94d1f7143ac3e49dad6 /db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb | |
parent | b70dbabb6373e7624e3bcb7a6d78049621db891c (diff) |
Add RateLimiter to RawController
* Limits raw requests to 300 per minute and per raw path.
* Add a new attribute to ApplicationSettings so user can change this
value on their instance.
* Uses Gitlab::ActionRateLimiter to limit the raw requests.
* Add a new method into ActionRateLimiter to log the event into auth.log
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/48717
Diffstat (limited to 'db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb')
-rw-r--r-- | db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb b/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb new file mode 100644 index 00000000000..e8198e11ea7 --- /dev/null +++ b/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRawBlobRequestLimitToApplicationSettings < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + add_column :application_settings, :raw_blob_request_limit, :integer, default: 300, null: false + end +end |