diff options
Diffstat (limited to 'config/initializers/rack_attack_new.rb')
-rw-r--r-- | config/initializers/rack_attack_new.rb | 12 |
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 |