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

signed_tag.rb « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 49194300a390e5335680491dfa8287d916e23c67 (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 Gitlab
  class SignedTag
    include Gitlab::Utils::StrongMemoize

    def initialize(repository, tag)
      @repository = repository
      @tag = tag
      @signature_data = Gitlab::Git::Tag.extract_signature_lazily(repository, tag.id) if repository
    end

    def signature
      return unless @tag.has_signature?
    end

    def signature_text
      @signature_data&.fetch(0)
    end

    def signed_text
      @signature_data&.fetch(1)
    end
  end
end