summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-27 04:24:36 +0000
committerStan Hu <stanhu@gmail.com>2019-08-27 04:24:36 +0000
commit8b47dfae2e82cfa48d6fa6dee6ddb7a00fc3f456 (patch)
treeb63b324adb12976cba06dec574a82a017602b2c7 /lib
parent53c39cc16edc9a60593a0d051543d834ebf6cff0 (diff)
parent2dd6f423b77c82436e3e0b3978d9bda513207b4b (diff)
downloadgitlab-ce-8b47dfae2e82cfa48d6fa6dee6ddb7a00fc3f456.tar.gz
Merge branch '63502-encrypt-deploy-token' into 'master'
Resolve "Store deploy tokens encrypted" Closes #63502 See merge request gitlab-org/gitlab-ce!30679
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/auth.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index e17a096ef19..6769bd95c2b 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -198,12 +198,10 @@ module Gitlab
end.uniq
end
- # rubocop: disable CodeReuse/ActiveRecord
def deploy_token_check(login, password)
return unless password.present?
- token =
- DeployToken.active.find_by(token: password)
+ token = DeployToken.active.find_by_token(password)
return unless token && login
return if login != token.username
@@ -214,7 +212,6 @@ module Gitlab
Gitlab::Auth::Result.new(token, token.project, :deploy_token, scopes)
end
end
- # rubocop: enable CodeReuse/ActiveRecord
def lfs_token_check(login, encoded_token, project)
deploy_key_matches = login.match(/\Alfs\+deploy-key-(\d+)\z/)