BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c32e6125
Commit
c32e6125
authored
Jun 15, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of Gitlab::ShellEnv
parent
a4a85c26
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
28 deletions
+4
-28
git_hooks_service.rb
app/services/git_hooks_service.rb
+1
-1
grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+0
-7
gl_id.rb
lib/gitlab/gl_id.rb
+2
-19
workhorse.rb
lib/gitlab/workhorse.rb
+1
-1
No files found.
app/services/git_hooks_service.rb
View file @
c32e6125
...
...
@@ -3,7 +3,7 @@ class GitHooksService
def
execute
(
user
,
repo_path
,
oldrev
,
newrev
,
ref
)
@repo_path
=
repo_path
@user
=
Gitlab
::
ShellEnv
.
gl_id
(
user
)
@user
=
Gitlab
::
GlId
.
gl_id
(
user
)
@oldrev
=
oldrev
@newrev
=
newrev
@ref
=
ref
...
...
lib/gitlab/backend/grack_auth.rb
View file @
c32e6125
require_relative
'shell_env'
module
Grack
class
AuthSpawner
def
self
.
call
(
env
)
...
...
@@ -61,11 +59,6 @@ module Grack
end
@user
=
authenticate_user
(
login
,
password
)
if
@user
Gitlab
::
ShellEnv
.
set_env
(
@user
)
@env
[
'REMOTE_USER'
]
=
@auth
.
username
end
end
def
ci_request?
(
login
,
password
)
...
...
lib/gitlab/
backend/shell_env
.rb
→
lib/gitlab/
gl_id
.rb
View file @
c32e6125
module
Gitlab
# This module provide 2 methods
# to set specific ENV variables for GitLab Shell
module
ShellEnv
extend
self
def
set_env
(
user
)
# Set GL_ID env variable
if
user
ENV
[
'GL_ID'
]
=
gl_id
(
user
)
end
end
def
reset_env
# Reset GL_ID env variable
ENV
[
'GL_ID'
]
=
nil
end
def
gl_id
(
user
)
module
GlId
def
self
.
gl_id
(
user
)
if
user
.
present?
"user-
#{
user
.
id
}
"
else
# This empty string is used in the render_grack_auth_ok method
""
end
end
...
...
lib/gitlab/workhorse.rb
View file @
c32e6125
...
...
@@ -8,7 +8,7 @@ module Gitlab
class
<<
self
def
git_http_ok
(
repository
,
user
)
{
'GL_ID'
=>
Gitlab
::
ShellEnv
.
gl_id
(
user
),
'GL_ID'
=>
Gitlab
::
GlId
.
gl_id
(
user
),
'RepoPath'
=>
repository
.
path_to_repo
,
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment