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:
authorAlexis Reigel <mail@koffeinfrei.org>2017-08-24 15:21:30 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-09-05 13:18:31 +0300
commit64855c8e30c53004b2e2c2a65f131f8ab7efa41c (patch)
tree2f9a4b4a6ae80847e1f88f068faa7ecb297d0535 /app/models/gpg_key.rb
parent508ff17b3405a4e2275fa137bd7322b728db8ed4 (diff)
match the committer's email against the gpg key
the updated verification of a gpg signature requires the committer's email to also match the user's and the key's emails.
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r--app/models/gpg_key.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb
index 3df60ddc950..cb46ff8145d 100644
--- a/app/models/gpg_key.rb
+++ b/app/models/gpg_key.rb
@@ -73,6 +73,10 @@ class GpgKey < ActiveRecord::Base
emails_with_verified_status.any? { |_email, verified| verified }
end
+ def verified_and_belongs_to_email?(email)
+ emails_with_verified_status.any? { |key_email, verified| key_email == email && verified }
+ end
+
def update_invalid_gpg_signatures
InvalidGpgSignatureUpdateWorker.perform_async(self.id)
end