Disallow access in the new registry model to hidden tags

This was causing problems with certain build cache pulls
This commit is contained in:
Joseph Schorr 2018-08-28 13:34:58 -04:00
parent c67da0c814
commit 70e233ab5c
3 changed files with 30 additions and 3 deletions

View file

@ -23,6 +23,7 @@ class PreOCIModel(RegistryDataInterface):
or None if none.
"""
found_tag = model.tag.find_matching_tag(repository_ref._db_id, tag_names)
assert found_tag is None or not found_tag.hidden
return Tag.for_repository_tag(found_tag)
def get_most_recent_tag(self, repository_ref):
@ -30,6 +31,7 @@ class PreOCIModel(RegistryDataInterface):
None.
"""
found_tag = model.tag.get_most_recent_tag(repository_ref._db_id)
assert found_tag is None or not found_tag.hidden
return Tag.for_repository_tag(found_tag)
def lookup_repository(self, namespace_name, repo_name, kind_filter=None):
@ -316,6 +318,8 @@ class PreOCIModel(RegistryDataInterface):
except database.RepositoryTag.DoesNotExist:
return None
assert not tag_obj.hidden
repo = tag_obj.repository
namespace_name = repo.namespace_user.username
repo_name = repo.name