key server: add kid to services JWKs

This commit is contained in:
Jimmy Zelinskie 2016-10-25 15:33:01 -04:00
parent 6f815907a4
commit b1327bcb8f

View file

@ -61,7 +61,13 @@ def _lookup_service_key(service, signer_kid, approved_only=True):
@key_server.route('/services/<service>/keys', methods=['GET'])
def list_service_keys(service):
keys = model.list_service_keys(service)
return jsonify({'keys': [key.jwk for key in keys]})
def jwk_with_kid(key):
jwk = key.jwk
jwk.update({'kid': key.kid})
return jwk
return jsonify({'keys': [jwk_with_kid(key) for key in keys]})
@key_server.route('/services/<service>/keys/<kid>', methods=['GET'])