Merge pull request #919 from jakedt/fixregistrytest
Fix anonymous repository pulls
This commit is contained in:
commit
e3c64afaf3
1 changed files with 3 additions and 4 deletions
|
@ -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():
|
||||
|
|
Reference in a new issue