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
Tatuya Kamada
gitlab-ce
Commits
9ef50db6
Commit
9ef50db6
authored
Apr 29, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify that oauth cannot push code
parent
d698d3e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+19
-0
No files found.
spec/requests/git_http_spec.rb
View file @
9ef50db6
...
@@ -179,6 +179,25 @@ describe 'Git HTTP requests', lib: true do
...
@@ -179,6 +179,25 @@ describe 'Git HTTP requests', lib: true do
end
end
end
end
context
"when an oauth token is provided"
do
before
do
application
=
Doorkeeper
::
Application
.
create!
(
name:
"MyApp"
,
redirect_uri:
"https://app.com"
,
owner:
user
)
@token
=
Doorkeeper
::
AccessToken
.
create!
(
application_id:
application
.
id
,
resource_owner_id:
user
.
id
)
end
it
"downloads get status 200"
do
clone_get
"
#{
project
.
path_with_namespace
}
.git"
,
user:
'oauth2'
,
password:
@token
.
token
expect
(
response
.
status
).
to
eq
(
200
)
end
it
"uploads get status 401 (no project existence information leak)"
do
push_get
"
#{
project
.
path_with_namespace
}
.git"
,
user:
'oauth2'
,
password:
@token
.
token
expect
(
response
.
status
).
to
eq
(
401
)
end
end
context
"when blank password attempts follow a valid login"
do
context
"when blank password attempts follow a valid login"
do
def
attempt_login
(
include_password
)
def
attempt_login
(
include_password
)
password
=
include_password
?
user
.
password
:
""
password
=
include_password
?
user
.
password
:
""
...
...
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