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
b3874294
Commit
b3874294
authored
May 16, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor
parent
a738a446
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
app/controllers/projects/git_http_client_controller.rb
app/controllers/projects/git_http_client_controller.rb
+0
-4
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+6
-6
No files found.
app/controllers/projects/git_http_client_controller.rb
View file @
b3874294
...
...
@@ -152,8 +152,4 @@ class Projects::GitHttpClientController < Projects::ApplicationController
def
has_authentication_ability?
(
capability
)
(
authentication_abilities
||
[]).
include?
(
capability
)
end
def
authentication_project
authentication_result
.
project
end
end
spec/lib/gitlab/git_access_spec.rb
View file @
b3874294
...
...
@@ -23,30 +23,30 @@ describe Gitlab::GitAccess, lib: true do
context
'ssh disabled'
do
before
do
disable_protocol
(
'ssh'
)
@acc
=
Gitlab
::
GitAccess
.
new
(
actor
,
project
,
'ssh'
,
authentication_abilities:
authentication_abilities
)
end
it
'blocks ssh git push'
do
expect
(
@acc
.
check
(
'git-receive-pack'
,
'_any'
).
allowed?
).
to
be_falsey
expect
(
access
.
check
(
'git-receive-pack'
,
'_any'
).
allowed?
).
to
be_falsey
end
it
'blocks ssh git pull'
do
expect
(
@acc
.
check
(
'git-upload-pack'
,
'_any'
).
allowed?
).
to
be_falsey
expect
(
access
.
check
(
'git-upload-pack'
,
'_any'
).
allowed?
).
to
be_falsey
end
end
context
'http disabled'
do
let
(
:protocol
)
{
'http'
}
before
do
disable_protocol
(
'http'
)
@acc
=
Gitlab
::
GitAccess
.
new
(
actor
,
project
,
'http'
,
authentication_abilities:
authentication_abilities
)
end
it
'blocks http push'
do
expect
(
@acc
.
check
(
'git-receive-pack'
,
'_any'
).
allowed?
).
to
be_falsey
expect
(
access
.
check
(
'git-receive-pack'
,
'_any'
).
allowed?
).
to
be_falsey
end
it
'blocks http git pull'
do
expect
(
@acc
.
check
(
'git-upload-pack'
,
'_any'
).
allowed?
).
to
be_falsey
expect
(
access
.
check
(
'git-upload-pack'
,
'_any'
).
allowed?
).
to
be_falsey
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