summaryrefslogtreecommitdiff
path: root/lib/gitlab/backend/shell_env.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-28 14:33:19 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-28 14:33:19 +0200
commitd3305df7aac4e632707492118a0ce91e67ed74ce (patch)
treeb5caa018eebc43883751b49c52cdf2b9dae5feb2 /lib/gitlab/backend/shell_env.rb
parentcd6046e1dd347f3a9bd7d062447aa25306a5755b (diff)
downloadgitlab-ce-d3305df7aac4e632707492118a0ce91e67ed74ce.tar.gz
Experimental support for gitlab-git-http-server
https://gitlab.com/gitlab-org/gitlab-git-http-server This change introduces the GITLAB_GRACK_AUTH_ONLY environment variable. When set, Grack requests to GitLab will only respond with the user's GL_ID (if the request is OK) or an error. This allows gitlab-git-http-server to use the main GitLab application as an authentication and authorization backend. If we like how this works we should drop the GITLAB_GRACK_AUTH_ONLY variable at some point in the future.
Diffstat (limited to 'lib/gitlab/backend/shell_env.rb')
-rw-r--r--lib/gitlab/backend/shell_env.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/backend/shell_env.rb b/lib/gitlab/backend/shell_env.rb
index 17ec029eed4..009a3ec1a4b 100644
--- a/lib/gitlab/backend/shell_env.rb
+++ b/lib/gitlab/backend/shell_env.rb
@@ -7,7 +7,7 @@ module Gitlab
def set_env(user)
# Set GL_ID env variable
if user
- ENV['GL_ID'] = "user-#{user.id}"
+ ENV['GL_ID'] = gl_id(user)
end
end
@@ -15,5 +15,9 @@ module Gitlab
# Reset GL_ID env variable
ENV['GL_ID'] = nil
end
+
+ def gl_id(user)
+ "user-#{user.id}"
+ end
end
end