summaryrefslogtreecommitdiff
path: root/lib/action/git_lfs_authenticate.rb
blob: 218c71e77107f7a3c94a7d622b2d5c7cbc835e07 (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
require_relative '../action'
require_relative '../gitlab_logger'

module Action
  class GitLFSAuthenticate < Base
    def initialize(key, repo_name)
      @key = key
      @repo_name = repo_name
    end

    def execute(_, _)
      GitlabMetrics.measure('lfs-authenticate') do
        $logger.info('Processing LFS authentication', user: key.log_username)
        lfs_access = api.lfs_authenticate(key.key_id, repo_name)
        return unless lfs_access

        puts lfs_access.authentication_payload
      end
      true
    end

    private

    attr_reader :key, :repo_name
  end
end