summaryrefslogtreecommitdiff
path: root/lib/gitlab_access.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-07-06 15:24:22 +0000
committerDouwe Maan <douwe@gitlab.com>2016-07-06 15:24:22 +0000
commitdd6eed168d75030a028da4f1ba5b5f1483de395a (patch)
treeebcf8c577cf09061803be5dddf60a0abda04450f /lib/gitlab_access.rb
parent5afdd3f1cc3f12d4e919edb554c755b227675d06 (diff)
parent02b8071c60f26318d660864450ca869cc8e6b7cf (diff)
downloadgitlab-shell-dd6eed168d75030a028da4f1ba5b5f1483de395a.tar.gz
Merge branch 'add-allowed-protocols-support' into 'master'
Allow GitLab Shell to check for allowed access based on the used Git protocol. Needed for gitlab-org/gitlab-ce!4696 and gitlab-org/gitlab-ce#18601 See merge request !62
Diffstat (limited to 'lib/gitlab_access.rb')
-rw-r--r--lib/gitlab_access.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb
index 10afeef..04806b2 100644
--- a/lib/gitlab_access.rb
+++ b/lib/gitlab_access.rb
@@ -9,18 +9,19 @@ class GitlabAccess
include NamesHelper
- attr_reader :config, :repo_path, :repo_name, :changes
+ attr_reader :config, :repo_path, :repo_name, :changes, :protocol
- def initialize(repo_path, actor, changes)
+ def initialize(repo_path, actor, changes, protocol)
@config = GitlabConfig.new
@repo_path = repo_path.strip
@actor = actor
@repo_name = extract_repo_name(@repo_path.dup)
@changes = changes.lines
+ @protocol = protocol
end
def exec
- status = api.check_access('git-receive-pack', @repo_name, @actor, @changes)
+ status = api.check_access('git-receive-pack', @repo_name, @actor, @changes, @protocol)
raise AccessDeniedError, status.message unless status.allowed?