From 6fd075dd1603465af9bfff22c16878ac1a3619fb Mon Sep 17 00:00:00 2001 From: Pino de Candia <32303022+pinodeca@users.noreply.github.com> Date: Thu, 25 Jan 2018 13:31:02 -0600 Subject: [PATCH] Rename Authority public key fields. --- tatu/api/models.py | 8 ++++---- tatu/ftests/test_api.py | 6 +++--- tatu/tests/test_app.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tatu/api/models.py b/tatu/api/models.py index 76c4e11..7d8adaf 100644 --- a/tatu/api/models.py +++ b/tatu/api/models.py @@ -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 diff --git a/tatu/ftests/test_api.py b/tatu/ftests/test_api.py index 8e9e330..6cc1b96 100644 --- a/tatu/ftests/test_api.py +++ b/tatu/ftests/test_api.py @@ -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') diff --git a/tatu/tests/test_app.py b/tatu/tests/test_app.py index 4b6594e..a268e8d 100644 --- a/tatu/tests/test_app.py +++ b/tatu/tests/test_app.py @@ -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