diff --git a/endpoints/key_server.py b/endpoints/key_server.py index 1d88c3689..c5522d0da 100644 --- a/endpoints/key_server.py +++ b/endpoints/key_server.py @@ -97,13 +97,19 @@ def get_service_key(service, kid): @key_server.route('/services//keys/', methods=['PUT']) def put_service_keys(service, kid): + metadata = {'ip': request.remote_addr} + expiration_date = request.args.get('expiration', None) - if expiration_date: + if expiration_date is not None: try: expiration_date = datetime.utcfromtimestamp(float(expiration_date)) except ValueError: abort(400) + rotation_ttl = request.args.get('rotation', None) + if rotation_ttl is not None: + metadata['rotation_ttl'] = rotation_ttl + try: jwk = request.get_json() except ValueError: @@ -119,7 +125,6 @@ def put_service_keys(service, kid): _validate_jwk(jwk, kid) - metadata = {'ip': request.remote_addr} signer_kid = _signer_kid(encoded_jwt) if kid == signer_kid or signer_kid is None: