Add a feature flag for disabling unauthenticated access to the registry in its entirety.
This commit is contained in:
parent
598fc6ec46
commit
54992c23b7
15 changed files with 147 additions and 25 deletions
|
@ -16,6 +16,7 @@ from auth.permissions import (ReadRepositoryPermission,
|
|||
ModifyRepositoryPermission)
|
||||
from data import model, database
|
||||
from util import gzipstream
|
||||
from endpoints.decorators import anon_protect
|
||||
|
||||
|
||||
registry = Blueprint('registry', __name__)
|
||||
|
@ -97,6 +98,7 @@ def set_cache_headers(f):
|
|||
@extract_namespace_repo_from_session
|
||||
@require_completion
|
||||
@set_cache_headers
|
||||
@anon_protect
|
||||
def head_image_layer(namespace, repository, image_id, headers):
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
|
||||
|
@ -130,6 +132,7 @@ def head_image_layer(namespace, repository, image_id, headers):
|
|||
@extract_namespace_repo_from_session
|
||||
@require_completion
|
||||
@set_cache_headers
|
||||
@anon_protect
|
||||
def get_image_layer(namespace, repository, image_id, headers):
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
|
||||
|
@ -352,6 +355,7 @@ def put_image_checksum(namespace, repository, image_id):
|
|||
@extract_namespace_repo_from_session
|
||||
@require_completion
|
||||
@set_cache_headers
|
||||
@anon_protect
|
||||
def get_image_json(namespace, repository, image_id, headers):
|
||||
logger.debug('Checking repo permissions')
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
|
@ -383,6 +387,7 @@ def get_image_json(namespace, repository, image_id, headers):
|
|||
@extract_namespace_repo_from_session
|
||||
@require_completion
|
||||
@set_cache_headers
|
||||
@anon_protect
|
||||
def get_image_ancestry(namespace, repository, image_id, headers):
|
||||
logger.debug('Checking repo permissions')
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
|
|
Reference in a new issue