diff options
Diffstat (limited to 'lib/gitlab/auth/request_authenticator.rb')
-rw-r--r-- | lib/gitlab/auth/request_authenticator.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/auth/request_authenticator.rb b/lib/gitlab/auth/request_authenticator.rb index b6ed6bbf2df..0948663b4b3 100644 --- a/lib/gitlab/auth/request_authenticator.rb +++ b/lib/gitlab/auth/request_authenticator.rb @@ -42,6 +42,10 @@ module Gitlab nil end + def can_sign_in_bot?(user) + user&.project_bot? && api_request? + end + # To prevent Rack Attack from incorrectly rate limiting # authenticated Git activity, we need to authenticate the user # from other means (e.g. HTTP Basic Authentication) only if the |