diff --git a/data/interfaces/verbs.py b/data/interfaces/verbs.py new file mode 100644 index 000000000..ba7af25f7 --- /dev/null +++ b/data/interfaces/verbs.py @@ -0,0 +1,18 @@ +class VerbsDataInterface(object): + """ + Interface that represents all data store interactions required by the registry's custom HTTP + verbs. + """ + @classmethod + def repository_is_public(cls, namespace_name, repo_name): + """ + Returns a boolean for whether the repository with the given name and namespace is public. + """ + raise NotImplementedError() + + +class PreOCIModel(VerbsDataInterface): + """ + PreOCIModel implements the data model for the registry's custom HTTP verbs using a database schema + before it was changed to support the OCI specification. + """ diff --git a/endpoints/verbs.py b/endpoints/verbs.py index 933fc9b0a..1f0124a38 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -31,8 +31,9 @@ logger = logging.getLogger(__name__) def _open_stream(formatter, namespace, repository, tag, synthetic_image_id, image_json, repo_image, handlers): - """ This method generates a stream of data which will be replicated and read from the queue files. - This method runs in a separate process. + """ + This method generates a stream of data which will be replicated and read from the queue files. + This method runs in a separate process. """ # For performance reasons, we load the full image list here, cache it, then disconnect from # the database.