Skip to content
Snippets Groups Projects

GPG signed commits

Merged Alexis Reigel requested to merge siemens/gitlab-ce:feature/gpg-signed-commits into master
Compare and Show latest version
9 files
+ 75
28
Compare changes
  • Side-by-side
  • Inline
Files
9
+ 8
10
@@ -38,16 +38,15 @@ class GpgKey < ActiveRecord::Base
after_commit :notify_user, on: :create
def primary_keyid
self[:primary_keyid]&.upcase
super&.upcase
end
def fingerprint
self[:fingerprint]&.upcase
super&.upcase
end
def key=(value)
value.strip! unless value.blank?
write_attribute(:key, value)
super(value&.strip)
end
def user_infos
@@ -78,12 +77,11 @@ def update_invalid_gpg_signatures
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
GpgSignature.where(gpg_key: self, valid_signature: true).update_all(
gpg_key_id: nil,
valid_signature: false,
updated_at: Time.zone.now
)
destroy
end
Loading