Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-14 18:12:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-14 18:12:05 +0300
commitb119503b7039d1e79b87300a145afdcd1145c2d6 (patch)
tree9977d51c4fd8177a20f1805c14f0cb6750baee1c /lib/gitlab/rack_attack
parentd378fdaa60adb7217e3fc798580ad206127728d5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/rack_attack')
-rw-r--r--lib/gitlab/rack_attack/request.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/rack_attack/request.rb b/lib/gitlab/rack_attack/request.rb
index 2f48e71a5cd..9deba0c7ca1 100644
--- a/lib/gitlab/rack_attack/request.rb
+++ b/lib/gitlab/rack_attack/request.rb
@@ -60,10 +60,19 @@ module Gitlab
path =~ protected_paths_regex
end
- def throttle_unauthenticated?
+ def throttle_unauthenticated_api?
+ api_request? &&
!should_be_skipped? &&
!throttle_unauthenticated_packages_api? &&
!throttle_unauthenticated_files_api? &&
+ Gitlab::Throttle.settings.throttle_unauthenticated_api_enabled &&
+ unauthenticated?
+ end
+
+ def throttle_unauthenticated_web?
+ web_request? &&
+ !should_be_skipped? &&
+ # TODO: Column will be renamed in https://gitlab.com/gitlab-org/gitlab/-/issues/340031
Gitlab::Throttle.settings.throttle_unauthenticated_enabled &&
unauthenticated?
end