diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-31 11:39:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-31 11:39:05 +0000 |
commit | 63a19a71aedcafe0148912c536a36768ed126533 (patch) | |
tree | ba59e27aa4138be3081c36918d18a717736eebf9 /lib | |
parent | 66ae38874a7a300887a2821354c079ae8aa69c26 (diff) | |
download | gitlab-ce-63a19a71aedcafe0148912c536a36768ed126533.tar.gz |
Add latest changes from gitlab-org/security/gitlab@13-12-stable-ee
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/x509/signature.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/x509/signature.rb b/lib/gitlab/x509/signature.rb index c83213e973b..a6761e211fa 100644 --- a/lib/gitlab/x509/signature.rb +++ b/lib/gitlab/x509/signature.rb @@ -23,7 +23,7 @@ module Gitlab end def user - User.find_by_any_email(@email) + strong_memoize(:user) { User.find_by_any_email(@email) } end def verified_signature @@ -31,9 +31,13 @@ module Gitlab end def verification_status - return :unverified if x509_certificate.nil? || x509_certificate.revoked? + return :unverified if + x509_certificate.nil? || + x509_certificate.revoked? || + !verified_signature || + user.nil? - if verified_signature && certificate_email == @email + if user.verified_emails.include?(@email) && certificate_email == @email :verified else :unverified |