Rename Authority public key fields.

This commit is contained in:
Pino de Candia 2018-01-25 13:31:02 -06:00
parent 6ecf7ceec7
commit 6fd075dd16
3 changed files with 10 additions and 10 deletions

View File

@ -97,8 +97,8 @@ class Authorities(object):
host_pub_key = host_key.publickey().exportKey('OpenSSH') host_pub_key = host_key.publickey().exportKey('OpenSSH')
items.append({ items.append({
'auth_id': auth.auth_id, 'auth_id': auth.auth_id,
'ca_user_pub': user_pub_key, 'user_pub_key': user_pub_key,
'ca_host_pub': host_pub_key, 'host_pub_key': host_pub_key,
}) })
body = {'CAs': items} body = {'CAs': items}
resp.body = json.dumps(body) resp.body = json.dumps(body)
@ -118,8 +118,8 @@ class Authority(object):
host_pub_key = host_key.publickey().exportKey('OpenSSH') host_pub_key = host_key.publickey().exportKey('OpenSSH')
body = { body = {
'auth_id': auth_id, 'auth_id': auth_id,
'ca_user_pub': user_pub_key, 'user_pub_key': user_pub_key,
'ca_host_pub': host_pub_key 'host_pub_key': host_pub_key
} }
resp.body = json.dumps(body) resp.body = json.dumps(body)
resp.status = falcon.HTTP_OK resp.status = falcon.HTTP_OK

View File

@ -52,9 +52,9 @@ def test_host_certificate_generation():
auth = json.loads(response.content) auth = json.loads(response.content)
assert 'auth_id' in auth assert 'auth_id' in auth
assert auth['auth_id'] == project_id assert auth['auth_id'] == project_id
assert 'ca_user_pub' in auth assert 'user_pub_key' in auth
assert 'ca_host_pub' in auth assert 'host_pub_key' in auth
ca_user = auth['ca_user_pub'] ca_user = auth['user_pub_key']
key = RSA.generate(2048) key = RSA.generate(2048)
pub_key = key.publickey().exportKey('OpenSSH') pub_key = key.publickey().exportKey('OpenSSH')

View File

@ -108,10 +108,10 @@ def test_get_authority(client):
assert response.status == falcon.HTTP_OK assert response.status == falcon.HTTP_OK
body = json.loads(response.content) body = json.loads(response.content)
assert 'auth_id' in body assert 'auth_id' in body
assert 'ca_user_pub' in body assert 'user_pub_key' in body
global auth_user_pub_key global auth_user_pub_key
auth_user_pub_key = body['ca_user_pub'] auth_user_pub_key = body['user_pub_key']
assert 'ca_host_pub' in body assert 'host_pub_key' in body
assert 'user_key' not in body assert 'user_key' not in body
assert 'host_key' not in body assert 'host_key' not in body