summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-20 20:40:56 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-07-05 16:54:22 -0500
commit7735ef86f0714a5b2a4cb4db8ec0471654563885 (patch)
tree5f56b0348da8870736339150b669069f84e43fd1 /lib/api/internal.rb
parentea9d910c8bd2774cf48a5b6092704143a7505011 (diff)
downloadgitlab-ce-7735ef86f0714a5b2a4cb4db8ec0471654563885.tar.gz
Only allow Git Access on the allowed protocol
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index b32503e8516..d5dfba5e0cc 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -13,6 +13,7 @@ module API
# action - git action (git-upload-pack or git-receive-pack)
# ref - branch name
# forced_push - forced_push
+ # protocol - Git access protocol being used, e.g. HTTP or SSH
#
helpers do
@@ -46,11 +47,13 @@ module API
User.find_by(id: params[:user_id])
end
+ protocol = params[:protocol]
+
access =
if wiki?
- Gitlab::GitAccessWiki.new(actor, project)
+ Gitlab::GitAccessWiki.new(actor, project, protocol)
else
- Gitlab::GitAccess.new(actor, project)
+ Gitlab::GitAccess.new(actor, project, protocol)
end
access_status = access.check(params[:action], params[:changes])