Commit d48eb77a authored by Alexis Reigel's avatar Alexis Reigel

allow updating of gpg signature through gpg commit

parent 502e31be
......@@ -29,6 +29,14 @@ module Gitlab
end
end
def update_signature!(cached_signature)
using_keychain do |gpg_key|
cached_signature.update_attributes!(
valid_signature: self.class.gpg_signature_valid_signature_value(gpg_key, verified_signature)
)
end
end
private
def using_keychain
......@@ -59,9 +67,13 @@ module Gitlab
project: commit.project,
gpg_key: gpg_key,
gpg_key_primary_keyid: gpg_key&.primary_keyid || verified_signature.fingerprint,
valid_signature: !!(gpg_key && gpg_key.verified? && verified_signature.valid?)
valid_signature: self.class.gpg_signature_valid_signature_value(gpg_key, verified_signature)
)
end
def self.gpg_signature_valid_signature_value(gpg_key, verified_signature_)
!!(gpg_key && gpg_key.verified? && verified_signature_.valid?)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment