diff options
Diffstat (limited to 'lib/action/git_lfs_authenticate.rb')
-rw-r--r-- | lib/action/git_lfs_authenticate.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/action/git_lfs_authenticate.rb b/lib/action/git_lfs_authenticate.rb new file mode 100644 index 0000000..d38d845 --- /dev/null +++ b/lib/action/git_lfs_authenticate.rb @@ -0,0 +1,26 @@ +require_relative '../action' +require_relative '../gitlab_logger' + +module Action + class GitLFSAuthenticate < Base + def initialize(key_id, repo_name) + @key_id = key_id + @repo_name = repo_name + end + + def execute(_, _) + GitlabMetrics.measure('lfs-authenticate') do + $logger.info('Processing LFS authentication', user: user.log_username) + lfs_access = api.lfs_authenticate(key_id, repo_name) + return unless lfs_access + + puts lfs_access.authentication_payload + end + true + end + + private + + attr_reader :key_id, :repo_name + end +end |