Prevent registry operations against disabled namespaces

Allows admins to completely wall off a namespace by disabling it

Fixes https://jira.coreos.com/browse/QUAY-869
This commit is contained in:
Joseph Schorr 2018-05-22 18:36:04 -04:00
parent 6ffafe44d3
commit f86c087b3b
14 changed files with 102 additions and 1 deletions

View file

@ -258,6 +258,10 @@ class PreOCIModel(DockerRegistryV2DataInterface):
except model.InvalidManifestException:
return
def is_namespace_enabled(self, namespace_name):
namespace = model.user.get_namespace_user(namespace_name)
return namespace is None or namespace.enabled
def _docker_v1_metadata(namespace_name, repo_name, repo_image):
"""