diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 00:06:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 00:06:29 +0300 |
commit | 430999251558db3c64b4adfc6e2b4fb771f6cd48 (patch) | |
tree | dd8bb7eab17ab8072179b9636bde34ec67ea17f5 /db | |
parent | e66d6781ef36e39d15b1b9bc84cc30e87969edad (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190801142441_add_throttle_protected_path_columns.rb | 25 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20190801142441_add_throttle_protected_path_columns.rb b/db/migrate/20190801142441_add_throttle_protected_path_columns.rb new file mode 100644 index 00000000000..bb6d54f3b7b --- /dev/null +++ b/db/migrate/20190801142441_add_throttle_protected_path_columns.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class AddThrottleProtectedPathColumns < ActiveRecord::Migration[5.2] + DOWNTIME = false + + DEFAULT_PROTECTED_PATHS = [ + '/users/password', + '/users/sign_in', + '/api/v3/session.json', + '/api/v3/session', + '/api/v4/session.json', + '/api/v4/session', + '/users', + '/users/confirmation', + '/unsubscribes/', + '/import/github/personal_access_token' + ] + + def change + add_column :application_settings, :throttle_protected_paths_enabled, :boolean, default: true, null: false + add_column :application_settings, :throttle_protected_paths_requests_per_period, :integer, default: 10, null: false + add_column :application_settings, :throttle_protected_paths_period_in_seconds, :integer, default: 60, null: false + add_column :application_settings, :protected_paths, :string, array: true, limit: 255, default: DEFAULT_PROTECTED_PATHS + end +end diff --git a/db/schema.rb b/db/schema.rb index 8fcced21d56..a1a5e19e75d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -322,6 +322,10 @@ ActiveRecord::Schema.define(version: 2019_09_26_041216) do t.string "encrypted_asset_proxy_secret_key_iv" t.string "static_objects_external_storage_url", limit: 255 t.string "static_objects_external_storage_auth_token", limit: 255 + t.boolean "throttle_protected_paths_enabled", default: true, null: false + t.integer "throttle_protected_paths_requests_per_period", default: 10, null: false + t.integer "throttle_protected_paths_period_in_seconds", default: 60, null: false + t.string "protected_paths", limit: 255, default: ["/users/password", "/users/sign_in", "/api/v3/session.json", "/api/v3/session", "/api/v4/session.json", "/api/v4/session", "/users", "/users/confirmation", "/unsubscribes/", "/import/github/personal_access_token"], array: true t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id" t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id" t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id" |