Add API endpoint for retrieving security status by *manifest*, rather than Docker V1 image ID

This commit is contained in:
Joseph Schorr 2017-02-02 17:51:18 -05:00
parent 0150abc488
commit cf539487a1
4 changed files with 107 additions and 33 deletions

View file

@ -10,8 +10,12 @@ wellknown = Blueprint('wellknown', __name__)
@wellknown.route('/app-capabilities', methods=['GET'])
def app_capabilities():
view_image_tmpl = '%s/{namespace}/{reponame}:{tag}' % get_app_url()
image_security_tmpl = ('%s/api/v1/repository/{namespace}/{reponame}/image/{imageid}/security' %
get_app_url())
image_security = '%s/api/v1/repository/{namespace}/{reponame}/image/{imageid}/security'
image_security_tmpl = image_security % get_app_url()
manifest_security = '%s/api/v1/repository/{namespace}/{reponame}/manifest/{digest}/security'
manifest_security_tmpl = manifest_security % get_app_url()
metadata = {
'appName': 'io.quay',
@ -23,6 +27,10 @@ def app_capabilities():
'io.quay.image-security': {
'rest-api-template': image_security_tmpl,
},
'io.quay.manifest-security': {
'rest-api-template': manifest_security_tmpl,
},
},
}