Commit 55222bae authored by Michael Kozono's avatar Michael Kozono

Merge branch 'fix_jwt_auth_for_not_existing_repository' into 'master'

Fix JWT token check when repository does not exist

See merge request gitlab-org/gitlab-ee!11033
parents b02d2bec 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
......
---
title: Fix JWT token check when repository does not exist
merge_request: 11033
author:
type: fixed
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment