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

commit.rb « ssh « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d9ac8c1b88127335b495d5841ed041aaaa19e7e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Gitlab
  module Ssh
    class Commit < Gitlab::SignedCommit
      private

      def signature_class
        CommitSignatures::SshSignature
      end

      def attributes
        signature = ::Gitlab::Ssh::Signature.new(signature_text, signed_text, @commit.committer_email)

        {
          commit_sha: @commit.sha,
          project: @commit.project,
          key_id: signature.signed_by_key&.id,
          key_fingerprint_sha256: signature.key_fingerprint,
          user_id: signature.signed_by_key&.user_id,
          verification_status: signature.verification_status
        }
      end
    end
  end
end