Make sure to verify service names on key creation
This commit is contained in:
parent
dc9bcec9ce
commit
28a80ef6a9
3 changed files with 24 additions and 1 deletions
|
@ -233,6 +233,13 @@ class KeyServerTestCase(EndpointTestCase):
|
|||
payload = self._get_test_jwt_payload()
|
||||
token = jwt.encode(payload, private_key.exportKey('PEM'), 'RS256')
|
||||
|
||||
# Invalid service name should yield a 400.
|
||||
self.putResponse('key_server.put_service_key', service='sample service', kid='kid420',
|
||||
headers={
|
||||
'Authorization': 'Bearer %s' % token,
|
||||
'Content-Type': 'application/json',
|
||||
}, data=jwk, expected_code=400)
|
||||
|
||||
# Publish a new key
|
||||
with assert_action_logged('service_key_create'):
|
||||
self.putResponse('key_server.put_service_key', service='sample_service', kid='kid420',
|
||||
|
|
Reference in a new issue