diff --git a/endpoints/v2/v2auth.py b/endpoints/v2/v2auth.py index 4dec3f342..f302d11ca 100644 --- a/endpoints/v2/v2auth.py +++ b/endpoints/v2/v2auth.py @@ -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():