Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
01ce58bd
Commit
01ce58bd
authored
7 years ago
by
David Turner (TS)
Committed by
David Turner
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add username to authorized result, so that gitlab-shell can pass it to hooks
parent
dbcf48af
No related branches found
No related tags found
1 merge request
!3051
CE upstream
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
GITLAB_SHELL_VERSION
+2
-1
2 additions, 1 deletion
GITLAB_SHELL_VERSION
lib/api/internal.rb
+7
-0
7 additions, 0 deletions
lib/api/internal.rb
lib/gitlab/git/hook.rb
+5
-6
5 additions, 6 deletions
lib/gitlab/git/hook.rb
lib/gitlab/workhorse.rb
+1
-1
1 addition, 1 deletion
lib/gitlab/workhorse.rb
with
15 additions
and
8 deletions
GITLAB_SHELL_VERSION
+
2
−
1
View file @
01ce58bd
5.9.2
5.9.3
This diff is collapsed.
Click to expand it.
lib/api/internal.rb
+
7
−
0
View file @
01ce58bd
...
...
@@ -31,6 +31,12 @@ class Internal < Grape::API
protocol
=
params
[
:protocol
]
actor
.
update_last_used_at
if
actor
.
is_a?
(
Key
)
user
=
if
actor
.
is_a?
(
Key
)
actor
.
user
else
actor
end
access_checker_klass
=
wiki?
?
Gitlab
::
GitAccessWiki
:
Gitlab
::
GitAccess
access_checker
=
access_checker_klass
...
...
@@ -47,6 +53,7 @@ class Internal < Grape::API
{
status:
true
,
gl_repository:
gl_repository
,
gl_username:
user
&
.
username
,
repository_path:
repository_path
,
gitaly:
gitaly_payload
(
params
[
:action
])
}
...
...
This diff is collapsed.
Click to expand it.
lib/gitlab/git/hook.rb
+
5
−
6
View file @
01ce58bd
...
...
@@ -83,12 +83,11 @@ def call_receive_hook(gl_id, gl_username, oldrev, newrev, ref)
def
call_update_hook
(
gl_id
,
gl_username
,
oldrev
,
newrev
,
ref
)
Dir
.
chdir
(
repo_path
)
do
stdout
,
stderr
,
status
=
Open3
.
capture3
(
{
'GL_ID'
=>
gl_id
,
'GL_USERNAME'
=>
gl_username
},
path
,
ref
,
oldrev
,
newrev
)
env
=
{
'GL_ID'
=>
gl_id
,
'GL_USERNAME'
=>
gl_username
}
stdout
,
stderr
,
status
=
Open3
.
capture3
(
env
,
path
,
ref
,
oldrev
,
newrev
)
[
status
.
success?
,
(
stderr
.
presence
||
stdout
).
gsub
(
/\R/
,
"<br>"
).
html_safe
]
end
end
...
...
This diff is collapsed.
Click to expand it.
lib/gitlab/workhorse.rb
+
1
−
1
View file @
01ce58bd
...
...
@@ -22,9 +22,9 @@ def git_http_ok(repository, is_wiki, user, action)
params
=
{
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
GL_REPOSITORY
:
Gitlab
::
GlRepository
.
gl_repository
(
project
,
is_wiki
),
GL_USERNAME
:
user
&
.
username
,
RepoPath
:
repo_path
}
server
=
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment