Commit 976fe50d authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'instance-config-rate-limit-git-lfs' into 'master'

Extend /help/instance_configuration with Git LFS rate limit

See merge request gitlab-org/gitlab!70397
parents 6176f4e8 455ad3b2
...@@ -98,6 +98,11 @@ class InstanceConfiguration ...@@ -98,6 +98,11 @@ class InstanceConfiguration
requests_per_period: application_settings[:throttle_authenticated_packages_api_requests_per_period], requests_per_period: application_settings[:throttle_authenticated_packages_api_requests_per_period],
period_in_seconds: application_settings[:throttle_authenticated_packages_api_period_in_seconds] period_in_seconds: application_settings[:throttle_authenticated_packages_api_period_in_seconds]
}, },
authenticated_git_lfs_api: {
enabled: application_settings[:throttle_authenticated_git_lfs_enabled],
requests_per_period: application_settings[:throttle_authenticated_git_lfs_requests_per_period],
period_in_seconds: application_settings[:throttle_authenticated_git_lfs_period_in_seconds]
},
issue_creation: application_setting_limit_per_minute(:issues_create_limit), issue_creation: application_setting_limit_per_minute(:issues_create_limit),
note_creation: application_setting_limit_per_minute(:notes_create_limit), note_creation: application_setting_limit_per_minute(:notes_create_limit),
project_export: application_setting_limit_per_minute(:project_export_limit), project_export: application_setting_limit_per_minute(:project_export_limit),
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
= render 'help/instance_configuration/rate_limit_row', title: _('Protected Paths: requests'), rate_limit: rate_limits[:protected_paths] = render 'help/instance_configuration/rate_limit_row', title: _('Protected Paths: requests'), rate_limit: rate_limits[:protected_paths]
= render 'help/instance_configuration/rate_limit_row', title: _('Package Registry: unauthenticated API requests'), rate_limit: rate_limits[:unauthenticated_packages_api], public_visible: true = render 'help/instance_configuration/rate_limit_row', title: _('Package Registry: unauthenticated API requests'), rate_limit: rate_limits[:unauthenticated_packages_api], public_visible: true
= render 'help/instance_configuration/rate_limit_row', title: _('Package Registry: authenticated API requests'), rate_limit: rate_limits[:authenticated_packages_api] = render 'help/instance_configuration/rate_limit_row', title: _('Package Registry: authenticated API requests'), rate_limit: rate_limits[:authenticated_packages_api]
= render 'help/instance_configuration/rate_limit_row', title: _('Authenticated Git LFS requests'), rate_limit: rate_limits[:authenticated_git_lfs_api]
= render 'help/instance_configuration/rate_limit_row', title: _('Issue creation requests'), rate_limit: rate_limits[:issue_creation] = render 'help/instance_configuration/rate_limit_row', title: _('Issue creation requests'), rate_limit: rate_limits[:issue_creation]
= render 'help/instance_configuration/rate_limit_row', title: _('Note creation requests'), rate_limit: rate_limits[:note_creation] = render 'help/instance_configuration/rate_limit_row', title: _('Note creation requests'), rate_limit: rate_limits[:note_creation]
= render 'help/instance_configuration/rate_limit_row', title: _('Project export requests'), rate_limit: rate_limits[:project_export] = render 'help/instance_configuration/rate_limit_row', title: _('Project export requests'), rate_limit: rate_limits[:project_export]
......
...@@ -4771,6 +4771,9 @@ msgstr "" ...@@ -4771,6 +4771,9 @@ msgstr ""
msgid "Authenticated Git LFS request rate limit" msgid "Authenticated Git LFS request rate limit"
msgstr "" msgstr ""
msgid "Authenticated Git LFS requests"
msgstr ""
msgid "Authenticated web rate limit period in seconds" msgid "Authenticated web rate limit period in seconds"
msgstr "" msgstr ""
......
...@@ -175,6 +175,9 @@ RSpec.describe InstanceConfiguration do ...@@ -175,6 +175,9 @@ RSpec.describe InstanceConfiguration do
throttle_authenticated_packages_api_enabled: true, throttle_authenticated_packages_api_enabled: true,
throttle_authenticated_packages_api_requests_per_period: 1011, throttle_authenticated_packages_api_requests_per_period: 1011,
throttle_authenticated_packages_api_period_in_seconds: 1012, throttle_authenticated_packages_api_period_in_seconds: 1012,
throttle_authenticated_git_lfs_enabled: true,
throttle_authenticated_git_lfs_requests_per_period: 1022,
throttle_authenticated_git_lfs_period_in_seconds: 1023,
issues_create_limit: 1013, issues_create_limit: 1013,
notes_create_limit: 1014, notes_create_limit: 1014,
project_export_limit: 1015, project_export_limit: 1015,
...@@ -196,6 +199,7 @@ RSpec.describe InstanceConfiguration do ...@@ -196,6 +199,7 @@ RSpec.describe InstanceConfiguration do
expect(rate_limits[:protected_paths]).to eq({ enabled: true, requests_per_period: 1007, period_in_seconds: 1008 }) expect(rate_limits[:protected_paths]).to eq({ enabled: true, requests_per_period: 1007, period_in_seconds: 1008 })
expect(rate_limits[:unauthenticated_packages_api]).to eq({ enabled: false, requests_per_period: 1009, period_in_seconds: 1010 }) expect(rate_limits[:unauthenticated_packages_api]).to eq({ enabled: false, requests_per_period: 1009, period_in_seconds: 1010 })
expect(rate_limits[:authenticated_packages_api]).to eq({ enabled: true, requests_per_period: 1011, period_in_seconds: 1012 }) expect(rate_limits[:authenticated_packages_api]).to eq({ enabled: true, requests_per_period: 1011, period_in_seconds: 1012 })
expect(rate_limits[:authenticated_git_lfs_api]).to eq({ enabled: true, requests_per_period: 1022, period_in_seconds: 1023 })
expect(rate_limits[:issue_creation]).to eq({ enabled: true, requests_per_period: 1013, period_in_seconds: 60 }) expect(rate_limits[:issue_creation]).to eq({ enabled: true, requests_per_period: 1013, period_in_seconds: 60 })
expect(rate_limits[:note_creation]).to eq({ enabled: true, requests_per_period: 1014, period_in_seconds: 60 }) expect(rate_limits[:note_creation]).to eq({ enabled: true, requests_per_period: 1014, period_in_seconds: 60 })
expect(rate_limits[:project_export]).to eq({ enabled: true, requests_per_period: 1015, period_in_seconds: 60 }) expect(rate_limits[:project_export]).to eq({ enabled: true, requests_per_period: 1015, period_in_seconds: 60 })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment