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
2d838890
Commit
2d838890
authored
Apr 15, 2019
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix JWT token check when repository does not exist
parent
35d4810f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
ee/app/controllers/ee/projects/git_http_controller.rb
ee/app/controllers/ee/projects/git_http_controller.rb
+3
-3
ee/changelogs/unreleased/fix_jwt_auth_for_not_existing_repository.yml
...s/unreleased/fix_jwt_auth_for_not_existing_repository.yml
+5
-0
ee/spec/requests/git_http_geo_spec.rb
ee/spec/requests/git_http_geo_spec.rb
+16
-0
No files found.
ee/app/controllers/ee/projects/git_http_controller.rb
View file @
2d838890
...
...
@@ -60,11 +60,11 @@ module EE
end
def
jwt_scope_valid?
decoded_authorization
[
:scope
]
==
repository
.
full_path
decoded_authorization
[
:scope
]
==
repository
_
full_path
end
def
repository
wiki?
?
project
.
wiki
.
repository
:
project
.
repository
def
repository
_full_path
File
.
join
(
params
[
:namespace_id
],
project_path
)
end
def
decoded_authorization
...
...
ee/changelogs/unreleased/fix_jwt_auth_for_not_existing_repository.yml
0 → 100644
View file @
2d838890
---
title
:
Fix JWT token check when repository does not exist
merge_request
:
11033
author
:
type
:
fixed
ee/spec/requests/git_http_geo_spec.rb
View file @
2d838890
...
...
@@ -348,6 +348,22 @@ describe "Git HTTP requests (Geo)", :geo do
end
end
context
'repository does not exist'
do
subject
do
make_request
response
end
def
make_request
full_path
=
project
.
full_path
project
.
destroy
get
"/
#{
full_path
}
.git/info/refs"
,
params:
{
service:
'git-upload-pack'
},
headers:
env
end
it
{
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
}
end
context
'invalid scope'
do
subject
do
make_request
...
...
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