diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-12 08:59:28 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:43:37 +0300 |
commit | 027309eb2ae54614a2ee1a0ca9e4cea76a86b94b (patch) | |
tree | d5479187f2a89e2a24e5a62044861effd05b841c /app/models/gpg_key.rb | |
parent | 111edaa9f75f402cc18c2bec5cab9aa6615d9c4d (diff) |
user may now revoke a gpg key
other than just removing a key, which doesn't affect the verified state
of a commit, revoking a key unverifies all signed commits.
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index 050245bd502..1977023536e 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -58,6 +58,17 @@ class GpgKey < ActiveRecord::Base InvalidGpgSignatureUpdateWorker.perform_async(self.id) end + def revoke + GpgSignature.where(gpg_key: self, valid_signature: true).find_each do |gpg_signature| + gpg_signature.update_attributes!( + gpg_key: nil, + valid_signature: false + ) + end + + destroy + end + private def extract_fingerprint |