From 803172d1ff4e1e54ded55690ff16714630bbc2dd Mon Sep 17 00:00:00 2001 From: matograine <tom.ngr@zaclys.net> Date: Mon, 21 Sep 2020 20:52:37 +0200 Subject: [PATCH] [enh] #301 : make `authfile` command display <pubkey:checksum> format --- silkaj/auth.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/silkaj/auth.py b/silkaj/auth.py index b2161a7d..91ca04f3 100644 --- a/silkaj/auth.py +++ b/silkaj/auth.py @@ -23,9 +23,12 @@ from pathlib import Path from duniterpy.key import SigningKey from duniterpy.key.scrypt_params import ScryptParams +# had to import display_pubkey_and_checksum from wot to avoid loop dependency. +from silkaj.wot import display_pubkey_and_checksum from silkaj.tools import message_exit from silkaj.constants import PUBKEY_PATTERN + SEED_HEX_PATTERN = "^[0-9a-fA-F]{64}$" PUBSEC_PUBKEY_PATTERN = "pub: ({0})".format(PUBKEY_PATTERN) PUBSEC_SIGNKEY_PATTERN = "sec: ([1-9A-HJ-NP-Za-km-z]{87,90})" @@ -48,12 +51,13 @@ def auth_method(ctx): def generate_auth_file(file): key = auth_method() authfile = Path(file) + pubkey_cksum = display_pubkey_and_checksum(key.pubkey) if authfile.is_file(): confirm( "Would you like to erase " + file + " by an authfile corresponding to following pubkey `" - + key.pubkey + + pubkey_cksum + "`?", abort=True, ) @@ -61,7 +65,7 @@ def generate_auth_file(file): print( "Authentication file 'authfile' generated and stored in current\ folder for following public key:", - key.pubkey, + pubkey_cksum, ) -- GitLab