diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-13 16:22:15 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:44:39 +0300 |
commit | cd01e82873b3cd471203dbf557c71571fd683d16 (patch) | |
tree | 08372f91287ec4c9a14d95044a0eff7fbe8e78c3 /app/models/gpg_key.rb | |
parent | 506836a695ae40ff200add21c639f3d13aaee9e9 (diff) |
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 |