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
17 files
+ 129
33
Compare changes
  • Side-by-side
  • Inline
Files
17
+ 6
2
@@ -28,7 +28,7 @@ class GpgKey < ActiveRecord::Base
@@ -28,7 +28,7 @@ class GpgKey < ActiveRecord::Base
unless: -> { errors.has_key?(:key) }
unless: -> { errors.has_key?(:key) }
before_validation :extract_fingerprint, :extract_primary_keyid
before_validation :extract_fingerprint, :extract_primary_keyid
after_create :update_invalid_gpg_signatures
after_create :update_invalid_gpg_signatures_after_create
after_create :notify_user
after_create :notify_user
def key=(value)
def key=(value)
@@ -54,7 +54,7 @@ def verified?
@@ -54,7 +54,7 @@ def verified?
end
end
def update_invalid_gpg_signatures
def update_invalid_gpg_signatures
Gitlab::Gpg::InvalidGpgSignatureUpdater.new(self).run
InvalidGpgSignatureUpdateWorker.perform_async(self.id)
end
end
private
private
@@ -74,4 +74,8 @@ def extract_primary_keyid
@@ -74,4 +74,8 @@ def extract_primary_keyid
def notify_user
def notify_user
run_after_commit { NotificationService.new.new_gpg_key(self) }
run_after_commit { NotificationService.new.new_gpg_key(self) }
end
end
 
 
def update_invalid_gpg_signatures_after_create
 
run_after_commit { update_invalid_gpg_signatures }
 
end
end
end
Loading