Rename Authority public key fields.
This commit is contained in:
parent
6ecf7ceec7
commit
6fd075dd16
@ -97,8 +97,8 @@ class Authorities(object):
|
||||
host_pub_key = host_key.publickey().exportKey('OpenSSH')
|
||||
items.append({
|
||||
'auth_id': auth.auth_id,
|
||||
'ca_user_pub': user_pub_key,
|
||||
'ca_host_pub': host_pub_key,
|
||||
'user_pub_key': user_pub_key,
|
||||
'host_pub_key': host_pub_key,
|
||||
})
|
||||
body = {'CAs': items}
|
||||
resp.body = json.dumps(body)
|
||||
@ -118,8 +118,8 @@ class Authority(object):
|
||||
host_pub_key = host_key.publickey().exportKey('OpenSSH')
|
||||
body = {
|
||||
'auth_id': auth_id,
|
||||
'ca_user_pub': user_pub_key,
|
||||
'ca_host_pub': host_pub_key
|
||||
'user_pub_key': user_pub_key,
|
||||
'host_pub_key': host_pub_key
|
||||
}
|
||||
resp.body = json.dumps(body)
|
||||
resp.status = falcon.HTTP_OK
|
||||
|
@ -52,9 +52,9 @@ def test_host_certificate_generation():
|
||||
auth = json.loads(response.content)
|
||||
assert 'auth_id' in auth
|
||||
assert auth['auth_id'] == project_id
|
||||
assert 'ca_user_pub' in auth
|
||||
assert 'ca_host_pub' in auth
|
||||
ca_user = auth['ca_user_pub']
|
||||
assert 'user_pub_key' in auth
|
||||
assert 'host_pub_key' in auth
|
||||
ca_user = auth['user_pub_key']
|
||||
|
||||
key = RSA.generate(2048)
|
||||
pub_key = key.publickey().exportKey('OpenSSH')
|
||||
|
@ -108,10 +108,10 @@ def test_get_authority(client):
|
||||
assert response.status == falcon.HTTP_OK
|
||||
body = json.loads(response.content)
|
||||
assert 'auth_id' in body
|
||||
assert 'ca_user_pub' in body
|
||||
assert 'user_pub_key' in body
|
||||
global auth_user_pub_key
|
||||
auth_user_pub_key = body['ca_user_pub']
|
||||
assert 'ca_host_pub' in body
|
||||
auth_user_pub_key = body['user_pub_key']
|
||||
assert 'host_pub_key' in body
|
||||
assert 'user_key' not in body
|
||||
assert 'host_key' not in body
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user