Welcome to mirror list, hosted at ThFree Co, Russian Federation.

invalid_gpg_signature_updater.rb « gpg « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1991911ef6ac53f9fbdb848432889587ed1db69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Gitlab
  module Gpg
    class InvalidGpgSignatureUpdater
      def initialize(gpg_key)
        @gpg_key = gpg_key
      end

      def run
        GpgSignature
          .select(:id, :commit_sha, :project_id)
          .where('gpg_key_id IS NULL OR verification_status <> ?', GpgSignature.verification_statuses[:verified])
          .where(gpg_key_primary_keyid: @gpg_key.keyids)
          .find_each { |sig| sig.gpg_commit&.update_signature!(sig) }
      end
    end
  end
end