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:
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 1a23814959d..332d0bc1478 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -26,6 +26,8 @@ module Gitlab
# Default scopes for OAuth applications that don't define their own
DEFAULT_SCOPES = [:api].freeze
+ CI_JOB_USER = 'gitlab-ci-token'
+
class << self
prepend_if_ee('EE::Gitlab::Auth') # rubocop: disable Cop/InjectEnterpriseEditionModule
@@ -126,7 +128,7 @@ module Gitlab
# rubocop:enable Gitlab/RailsLogger
def skip_rate_limit?(login:)
- ::Ci::Build::CI_REGISTRY_USER == login
+ CI_JOB_USER == login
end
def look_to_limit_user(actor)
@@ -257,7 +259,7 @@ module Gitlab
end
def build_access_token_check(login, password)
- return unless login == 'gitlab-ci-token'
+ return unless login == CI_JOB_USER
return unless password
build = find_build_by_token(password)