Fix anonymous repository pulls

This commit is contained in:
Jake Moshenko 2015-11-18 20:11:06 -05:00
parent 04f2688944
commit 39d799b1aa

View file

@ -78,11 +78,10 @@ def generate_registry_jwt():
if not REPOSITORY_NAME_REGEX.match(reponame):
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 user is None and token is None:
abort(401)
repo = model.repository.get_repository(namespace, reponame)
if repo:
if not ModifyRepositoryPermission(namespace, reponame).can():