diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-13 15:22:15 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:44:39 +0200 |
commit | cd01e82873b3cd471203dbf557c71571fd683d16 (patch) | |
tree | 08372f91287ec4c9a14d95044a0eff7fbe8e78c3 /app/models/gpg_key.rb | |
parent | 506836a695ae40ff200add21c639f3d13aaee9e9 (diff) | |
download | gitlab-ce-cd01e82873b3cd471203dbf557c71571fd683d16.tar.gz |
store gpg user name and email on the signature
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index 1977023536e..31a25f3e2f0 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -37,15 +37,21 @@ class GpgKey < ActiveRecord::Base write_attribute(:key, value) end - def emails - @emails ||= Gitlab::Gpg.emails_from_key(key) + def user_infos + @user_infos ||= Gitlab::Gpg.user_infos_from_key(key) + end + + def verified_user_infos + user_infos.select do |user_info| + user_info[:email] == user.email + end end def emails_with_verified_status - emails.map do |email| + user_infos.map do |user_info| [ - email, - email == user.email + user_info[:email], + user_info[:email] == user.email ] end.to_h end |