summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-30 13:37:09 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-09-06 12:11:17 -0500
commitf53d09e1eb1323be9cd697813a6f47375c091f6a (patch)
tree42b1950e5a8f0a7d3f97cf37e1c279793fc7c30d /lib/gitlab_shell.rb
parentc16f7323bad61601df1ebe93475bd84aee532faf (diff)
downloadgitlab-shell-f53d09e1eb1323be9cd697813a6f47375c091f6a.tar.gz
Refactored LFS auth logic to use its own API endpoint.
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 87fa347..d3f9bbe 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -1,7 +1,6 @@
require 'shellwords'
require_relative 'gitlab_net'
-require_relative 'gitlab_lfs_authentication'
class GitlabShell
class AccessDeniedError < StandardError; end
@@ -12,7 +11,7 @@ class GitlabShell
API_COMMANDS = %w(2fa_recovery_codes)
GL_PROTOCOL = 'ssh'.freeze
- attr_accessor :key_id, :repo_name, :command, :git_access, :repository_http_path
+ attr_accessor :key_id, :repo_name, :command, :git_access
attr_reader :repo_path
def initialize(key_id)
@@ -95,7 +94,6 @@ class GitlabShell
raise AccessDeniedError, status.message unless status.allowed?
self.repo_path = status.repository_path
- @repository_http_path = status.repository_http_path
end
def process_cmd(args)
@@ -192,9 +190,11 @@ class GitlabShell
end
def lfs_authenticate
- return unless user
+ lfs_access = api.lfs_authenticate(@key_id, @repo_name)
- puts GitlabLfsAuthentication.new(user, repository_http_path).authenticate!
+ return unless lfs_access
+
+ puts lfs_access.authenticate!
end
private