diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-10-23 13:15:56 +0300 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-12-05 07:22:37 +0300 |
commit | 22954f220231281360377922b709efb904559949 (patch) | |
tree | 261ad26a7b980dcb0494e20f9e4b4837b429bd81 /lib/gitlab/auth.rb | |
parent | 3bccd2b17952bfa2db3f2e1fbca8ee93cf5f5654 (diff) |
LfsToken uses JSONWebToken::HMACToken by default
LfsToken::HMACToken#token_valid?() will be examined and if false, look
in redis via LfsToken::LegacyRedisDeviseToken#token_valid?().
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r-- | lib/gitlab/auth.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 6eb5f9e2300..7aa02009aa0 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -199,7 +199,7 @@ module Gitlab end # rubocop: enable CodeReuse/ActiveRecord - def lfs_token_check(login, password, project) + def lfs_token_check(login, encoded_token, project) deploy_key_matches = login.match(/\Alfs\+deploy-key-(\d+)\z/) actor = @@ -222,7 +222,7 @@ module Gitlab read_authentication_abilities end - if Devise.secure_compare(token_handler.token, password) + if token_handler.token_valid?(encoded_token) Gitlab::Auth::Result.new(actor, nil, token_handler.type, authentication_abilities) end end |