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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
73f3bea8
Commit
73f3bea8
authored
Aug 15, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d66d74a7
90328145
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
app/controllers/projects/git_http_client_controller.rb
app/controllers/projects/git_http_client_controller.rb
+6
-1
changelogs/unreleased/dblessing-fix-public-project-ssh-only-ci-failure.yml
...ased/dblessing-fix-public-project-ssh-only-ci-failure.yml
+5
-0
spec/controllers/projects/git_http_controller_spec.rb
spec/controllers/projects/git_http_controller_spec.rb
+11
-0
No files found.
app/controllers/projects/git_http_client_controller.rb
View file @
73f3bea8
...
...
@@ -49,7 +49,8 @@ class Projects::GitHttpClientController < Projects::ApplicationController
send_final_spnego_response
return
# Allow access
end
elsif
project
&&
download_request?
&&
Guest
.
can?
(
:download_code
,
project
)
elsif
project
&&
download_request?
&&
http_allowed?
&&
Guest
.
can?
(
:download_code
,
project
)
@authentication_result
=
Gitlab
::
Auth
::
Result
.
new
(
nil
,
project
,
:none
,
[
:download_code
])
return
# Allow access
...
...
@@ -113,6 +114,10 @@ class Projects::GitHttpClientController < Projects::ApplicationController
def
ci?
authentication_result
.
ci?
(
project
)
end
def
http_allowed?
Gitlab
::
ProtocolAccess
.
allowed?
(
'http'
)
end
end
Projects
::
GitHttpClientController
.
prepend_if_ee
(
'EE::Projects::GitHttpClientController'
)
changelogs/unreleased/dblessing-fix-public-project-ssh-only-ci-failure.yml
0 → 100644
View file @
73f3bea8
---
title
:
Allow CI to clone public projects when HTTP protocol is disabled
merge_request
:
31632
author
:
type
:
fixed
spec/controllers/projects/git_http_controller_spec.rb
View file @
73f3bea8
...
...
@@ -12,4 +12,15 @@ describe Projects::GitHttpController do
expect
(
response
.
status
).
to
eq
(
403
)
end
end
describe
'GET #info_refs'
do
it
'returns 401 for unauthenticated requests to public repositories when http protocol is disabled'
do
stub_application_setting
(
enabled_git_access_protocol:
'ssh'
)
project
=
create
(
:project
,
:public
,
:repository
)
get
:info_refs
,
params:
{
service:
'git-upload-pack'
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
path
+
'.git'
}
expect
(
response
.
status
).
to
eq
(
401
)
end
end
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