Merge pull request #780 from itmustbejj/fix_alice_cli_derive_policy_pubkey

Update cli/alice.py to use new format for the /derive_policy_pubkey e…
pull/792/head
K Prasch 2019-02-17 08:44:00 -07:00 committed by GitHub
commit bd77bf5f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -20,11 +20,11 @@ from nucypher.config.constants import GLOBAL_DOMAIN
ALICE_BANNER = r"""
/ \ | (_) ___ ___
/ \ | (_) ___ ___
/ _ \ | | |/ __/ _ \
/ ___ \| | | (_| __/
/_/ \_|_|_|\___\___|
the Authority.
"""
@ -209,10 +209,7 @@ def alice(click_config,
return
elif action == "derive-policy":
request_data = {
'label': b64encode(bytes(label, encoding='utf-8')).decode(),
}
response = requests.post(f'http://localhost:{http_port}/derive_policy_pubkey', data=json.dumps(request_data))
response = requests.post(f'http://localhost:{http_port}/derive_policy_pubkey/{label}')
response_data = response.json()
policy_encrypting_key = response_data['result']['policy_encrypting_pubkey']