From af27a1b6dc50adb358593f44d07218014d6cb995 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Thu, 20 Jul 2017 14:24:43 -0400 Subject: [PATCH] Add a data interface for manifest labels API --- endpoints/api/manifest.py | 92 +++++++++------------- endpoints/api/manifest_models_interface.py | 42 ++++++++++ endpoints/api/manifest_models_pre_oci.py | 50 ++++++++++++ 3 files changed, 128 insertions(+), 56 deletions(-) create mode 100644 endpoints/api/manifest_models_interface.py create mode 100644 endpoints/api/manifest_models_pre_oci.py diff --git a/endpoints/api/manifest.py b/endpoints/api/manifest.py index 66716da3f..7eaad827b 100644 --- a/endpoints/api/manifest.py +++ b/endpoints/api/manifest.py @@ -4,10 +4,11 @@ from app import label_validator from flask import request from endpoints.api import (resource, nickname, require_repo_read, require_repo_write, RepositoryParamResource, log_action, validate_json_request, - path_param, parse_args, query_param, truthy_bool, abort, api, + path_param, parse_args, query_param, abort, api, disallow_for_app_repositories) from endpoints.exception import NotFound -from data import model +from manifest_models_pre_oci import pre_oci_model as model +from data.model import InvalidLabelKeyException, InvalidMediaTypeException from digest import digest_tools from util.validation import VALID_LABEL_KEY_REGEX @@ -16,16 +17,6 @@ BASE_MANIFEST_ROUTE = '/v1/repository//manifest/