Merge pull request #2035 from jzelinskie/kids

key server: add kid to services JWKs
This commit is contained in:
Jimmy Zelinskie 2016-10-25 15:38:38 -04:00 committed by GitHub
commit ea5039877c

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'])