Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
3c0f6da5
Commit
3c0f6da5
authored
Mar 06, 2018
by
Kim "BKC" Carlbäcker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make git push mandatory
parent
5e8138aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
25 deletions
+4
-25
lib/api/helpers/internal_helpers.rb
lib/api/helpers/internal_helpers.rb
+0
-7
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+4
-18
No files found.
lib/api/helpers/internal_helpers.rb
View file @
3c0f6da5
...
...
@@ -111,13 +111,6 @@ module API
def
gitaly_payload
(
action
)
return
unless
%w[git-receive-pack git-upload-pack]
.
include?
(
action
)
if
action
==
'git-receive-pack'
return
unless
Gitlab
::
GitalyClient
.
feature_enabled?
(
:ssh_receive_pack
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
end
{
repository:
repository
.
gitaly_repository
,
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
...
...
lib/gitlab/workhorse.rb
View file @
3c0f6da5
...
...
@@ -10,6 +10,7 @@ module Gitlab
INTERNAL_API_CONTENT_TYPE
=
'application/vnd.gitlab-workhorse+json'
.
freeze
INTERNAL_API_REQUEST_HEADER
=
'Gitlab-Workhorse-Api-Request'
.
freeze
NOTIFICATION_CHANNEL
=
'workhorse:notifications'
.
freeze
ALLOWED_ACTIONS
=
%w[git_receive_pack git_upload_pack info_refs]
.
freeze
# Supposedly the effective key size for HMAC-SHA256 is 256 bits, i.e. 32
# bytes https://tools.ietf.org/html/rfc4868#section-2.6
...
...
@@ -17,6 +18,8 @@ module Gitlab
class
<<
self
def
git_http_ok
(
repository
,
is_wiki
,
user
,
action
,
show_all_refs:
false
)
raise
"Unsupported action:
#{
action
}
"
unless
ALLOWED_ACTIONS
.
include?
(
action
.
to_s
)
project
=
repository
.
project
repo_path
=
repository
.
path_to_repo
params
=
{
...
...
@@ -31,24 +34,7 @@ module Gitlab
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
}
params
[
:Repository
]
=
repository
.
gitaly_repository
.
to_h
feature_enabled
=
case
action
.
to_s
when
'git_receive_pack'
Gitlab
::
GitalyClient
.
feature_enabled?
(
:post_receive_pack
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
when
'git_upload_pack'
true
when
'info_refs'
true
else
raise
"Unsupported action:
#{
action
}
"
end
if
feature_enabled
params
[
:GitalyServer
]
=
server
end
params
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