mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-25 04:26:08 +10:00
Merge pull request #8928 from Mic92/master
use constant-time string compare for internal api authentication
This commit is contained in:
+4
-1
@@ -83,7 +83,10 @@ module API
|
||||
end
|
||||
|
||||
def authenticate_by_gitlab_shell_token!
|
||||
unauthorized! unless secret_token == params['secret_token'].try(:chomp)
|
||||
input = params['secret_token'].try(:chomp)
|
||||
unless Devise.secure_compare(secret_token, input)
|
||||
unauthorized!
|
||||
end
|
||||
end
|
||||
|
||||
def authenticated_as_admin!
|
||||
|
||||
Reference in New Issue
Block a user