summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-08 14:49:28 +0000
committerRémy Coutable <remy@rymai.me>2017-02-08 14:49:28 +0000
commit31d6e247041d4bb13aa712dcbbfad10ee5e403b8 (patch)
tree2d6500c76b7a3d9e67e32c1cff0a849e8965ab32 /lib/api/internal.rb
parentf0453905418dab64a1a53ff67044a5eb8f7aa333 (diff)
parentb54b031638e7a98c1e51b369cff53602db40e4b0 (diff)
downloadgitlab-ce-31d6e247041d4bb13aa712dcbbfad10ee5e403b8.tar.gz
Merge branch 'backport-7967-and-8189-to-8-13-stable' into '8-13-stable' 8-13-stable
Backport !7967 and !8189 to `8-13-stable` See merge request !8991
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 9a5d1ece070..89e47a7b0f5 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -43,6 +43,14 @@ module API
:push_code
]
end
+
+ def parse_allowed_environment_variables
+ return if params[:env].blank?
+
+ JSON.parse(params[:env])
+
+ rescue JSON::ParserError
+ end
end
post "/allowed" do
@@ -61,7 +69,11 @@ module API
if wiki?
Gitlab::GitAccessWiki.new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities)
else
- Gitlab::GitAccess.new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities)
+ Gitlab::GitAccess.new(actor,
+ project,
+ protocol,
+ authentication_abilities: ssh_authentication_abilities,
+ env: parse_allowed_environment_variables)
end
access_status = access.check(params[:action], params[:changes])