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

x509_commit_signature.rb « commit_signatures « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4edbc147502929f3fb37f166bda7171fd822277f (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
# frozen_string_literal: true
module CommitSignatures
  class X509CommitSignature < ApplicationRecord
    include CommitSignature
    include SignatureType

    belongs_to :x509_certificate, class_name: 'X509Certificate', foreign_key: 'x509_certificate_id', optional: false

    validates :x509_certificate_id, presence: true

    def type
      :x509
    end

    def x509_commit
      return unless commit

      Gitlab::X509::Commit.new(commit)
    end

    def signed_by_user
      commit&.committer
    end
  end
end