allow updating of gpg signature through gpg commit
This commit is contained in:
parent
502e31bec9
commit
d48eb77a96
1 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue