parent
640925e47c
commit
2fb43196c6
2 changed files with 33 additions and 0 deletions
31
endpoints/wellknown.py
Normal file
31
endpoints/wellknown.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
import json
|
||||
import logging
|
||||
|
||||
from app import get_app_url
|
||||
from flask import Blueprint, make_response
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
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())
|
||||
|
||||
metadata = {
|
||||
'appName': 'io.quay',
|
||||
'capabilities': {
|
||||
'io.quay.view-image': {
|
||||
'url-template': view_image_tmpl,
|
||||
},
|
||||
|
||||
'io.quay.image-security': {
|
||||
'rest-api-template': image_security_tmpl,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
resp = make_response(json.dumps(metadata))
|
||||
resp.headers['Content-Type'] = 'application/json'
|
||||
return resp
|
Reference in a new issue