diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-07-26 19:06:20 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 00:24:16 +1000 |
commit | ecba183b60eb0798ecf1736659ed7d0a995d0f01 (patch) | |
tree | 3606b2d25e914f69f6cc9aab6de7864331b49dbf /lib/gitlab_access.rb | |
parent | 252a96d61f52d91486f92f980c2f0e4c7a1b9408 (diff) | |
download | gitlab-shell-ecba183b60eb0798ecf1736659ed7d0a995d0f01.tar.gz |
Utilise new Actions
* Move gitaly, git-lfs and 2FA logic out from gitlab_shell.rb
* Streamline parsing of origin_cmd in GitlabShell
* Utilise proper HTTP status codes sent from the API
* Also support 200 OK with status of true/false (ideally get rid of this)
* Use HTTP status constants
* Use attr_reader definitions (var over @var)
* Rspec deprecation fixes
Diffstat (limited to 'lib/gitlab_access.rb')
-rw-r--r-- | lib/gitlab_access.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 8994789..4f3f2ad 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -20,12 +20,9 @@ class GitlabAccess end def exec - status = GitlabMetrics.measure('check-access:git-receive-pack') do - api.check_access('git-receive-pack', @gl_repository, @repo_path, @key_id, @changes, @protocol, env: ObjectDirsHelper.all_attributes.to_json) + GitlabMetrics.measure('check-access:git-receive-pack') do + api.check_access('git-receive-pack', gl_repository, repo_path, key_id, changes, protocol, env: ObjectDirsHelper.all_attributes.to_json) end - - raise AccessDeniedError, status.message unless status.allowed? - true rescue GitlabNet::ApiUnreachableError $stderr.puts "GitLab: Failed to authorize your Git request: internal API unreachable" |