Fix anonymous repository pulls
This commit is contained in:
parent
04f2688944
commit
39d799b1aa
1 changed files with 3 additions and 4 deletions
|
@ -78,11 +78,10 @@ def generate_registry_jwt():
|
||||||
if not REPOSITORY_NAME_REGEX.match(reponame):
|
if not REPOSITORY_NAME_REGEX.match(reponame):
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
if ('pull' in actions or 'push' in actions) and user is None and token is None:
|
|
||||||
# We are trying to perform a registry action without auth
|
|
||||||
abort(401)
|
|
||||||
|
|
||||||
if 'pull' in actions and 'push' in actions:
|
if 'pull' in actions and 'push' in actions:
|
||||||
|
if user is None and token is None:
|
||||||
|
abort(401)
|
||||||
|
|
||||||
repo = model.repository.get_repository(namespace, reponame)
|
repo = model.repository.get_repository(namespace, reponame)
|
||||||
if repo:
|
if repo:
|
||||||
if not ModifyRepositoryPermission(namespace, reponame).can():
|
if not ModifyRepositoryPermission(namespace, reponame).can():
|
||||||
|
|
Reference in a new issue