summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 12:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 12:08:10 +0000
commitb86f474bf51e20d2db4cf0895d0a8e0894e31c08 (patch)
tree061d2a4c749924f5a35fe6199dd1d8982c4b0b27 /config
parent6b8040dc25fdc5fe614c3796a147517dd50bc7d8 (diff)
downloadgitlab-ce-b86f474bf51e20d2db4cf0895d0a8e0894e31c08.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r--config/initializers/rack_attack_new.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/config/initializers/rack_attack_new.rb b/config/initializers/rack_attack_new.rb
index 6d29bb1cd8b..267d4c1eda9 100644
--- a/config/initializers/rack_attack_new.rb
+++ b/config/initializers/rack_attack_new.rb
@@ -113,11 +113,15 @@ class Rack::Attack
class Request
def unauthenticated?
- !authenticated_user_id([:api, :rss, :ics])
+ !(authenticated_user_id([:api, :rss, :ics]) || authenticated_runner_id)
end
def authenticated_user_id(request_formats)
- Gitlab::Auth::RequestAuthenticator.new(self).user(request_formats)&.id
+ request_authenticator.user(request_formats)&.id
+ end
+
+ def authenticated_runner_id
+ request_authenticator.runner&.id
end
def api_request?
@@ -150,6 +154,10 @@ class Rack::Attack
private
+ def request_authenticator
+ @request_authenticator ||= Gitlab::Auth::RequestAuthenticator.new(self)
+ end
+
def protected_paths
Gitlab::CurrentSettings.current_application_settings.protected_paths
end