diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-02 11:55:57 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-02 15:07:17 +1000 |
commit | 4a03bd220d36b09aa1b38840b7304f182d623f59 (patch) | |
tree | 8fa2701ff56f8900b2f972600021dd58a31e2f4e /lib | |
parent | 1e96cc63a931c2665e1cacfd53c42e25c96c3b65 (diff) | |
parent | c6577e0d75f51b017f2f332838b97c3ca5b497c0 (diff) | |
download | gitlab-shell-4a03bd220d36b09aa1b38840b7304f182d623f59.tar.gz |
Merge remote-tracking branch 'origin/master' into ash.mckenzie/srp-refactor
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action/api_2fa_recovery.rb | 2 | ||||
-rw-r--r-- | lib/action/git_lfs_authenticate.rb | 2 | ||||
-rw-r--r-- | lib/action/gitaly.rb | 11 |
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/action/api_2fa_recovery.rb b/lib/action/api_2fa_recovery.rb index ad8130f..06f8057 100644 --- a/lib/action/api_2fa_recovery.rb +++ b/lib/action/api_2fa_recovery.rb @@ -34,7 +34,7 @@ module Action return end - resp = api.two_factor_recovery_codes(self) + resp = api.two_factor_recovery_codes(actor) if resp['success'] codes = resp['recovery_codes'].join("\n") $logger.info('API 2FA recovery success', user: actor.log_username) diff --git a/lib/action/git_lfs_authenticate.rb b/lib/action/git_lfs_authenticate.rb index d2e6d76..8c5294d 100644 --- a/lib/action/git_lfs_authenticate.rb +++ b/lib/action/git_lfs_authenticate.rb @@ -11,7 +11,7 @@ module Action def execute(_, _) GitlabMetrics.measure('lfs-authenticate') do $logger.info('Processing LFS authentication', user: actor.log_username) - lfs_access = api.lfs_authenticate(self, repo_name) + lfs_access = api.lfs_authenticate(actor, repo_name) return unless lfs_access puts lfs_access.authentication_payload diff --git a/lib/action/gitaly.rb b/lib/action/gitaly.rb index 569a1b7..b95ff17 100644 --- a/lib/action/gitaly.rb +++ b/lib/action/gitaly.rb @@ -11,10 +11,11 @@ module Action 'git-receive-pack' => File.join(ROOT_PATH, 'bin', 'gitaly-receive-pack') }.freeze - def initialize(actor, gl_repository, gl_username, repository_path, gitaly) + def initialize(actor, gl_repository, gl_username, git_protocol, repository_path, gitaly) @actor = actor @gl_repository = gl_repository @gl_username = gl_username + @git_protocol = git_protocol @repository_path = repository_path @gitaly = gitaly end @@ -23,6 +24,7 @@ module Action new(actor, json['gl_repository'], json['gl_username'], + json['git_protocol'], json['repository_path'], json['gitaly']) end @@ -39,6 +41,10 @@ module Action attr_reader :actor, :gl_repository, :gl_username, :repository_path, :gitaly + def git_protocol + @git_protocol || ENV['GIT_PROTOCOL'] # TODO: tidy this up + end + def process(command, args) executable = command args = [repository_path] @@ -91,7 +97,8 @@ module Action 'repository' => gitaly['repository'], 'gl_repository' => gl_repository, 'gl_id' => actor.identifier, - 'gl_username' => gl_username + 'gl_username' => gl_username, + 'git_protocol' => git_protocol } end |