From: Steven Baltakatei Sandoval Date: Sat, 4 Jul 2020 21:44:49 +0000 (+0000) Subject: fix(unitproc):validateInput:Fix keytype X-Git-Tag: 0.3.0~61 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/5ac0ccd6ee909a05d7ec851d6abc4184ecb7ec94?hp=-c fix(unitproc):validateInput:Fix keytype "bech32" should be "age_pubkey". --- 5ac0ccd6ee909a05d7ec851d6abc4184ecb7ec94 diff --git a/unitproc/bktemp-validateInput b/unitproc/bktemp-validateInput index 2f39d8b..8126747 100644 --- a/unitproc/bktemp-validateInput +++ b/unitproc/bktemp-validateInput @@ -7,7 +7,7 @@ try() { "$@" || die "cannot $*"; } #o validateInput() { # Desc: Validates Input # Usage: validateInput [str input] [str input type] - # Version: 0.2.0 + # Version: 0.2.1 # Input: arg1: string to validate # arg2: string specifying input type (ex:"ssh_pubkey") # Output: return code 0: if input string matched specified string type @@ -33,7 +33,7 @@ validateInput() { ## age_pubkey ### Check for age1[:bech32:] - if [[ "$argType" = "bech32" ]]; then + if [[ "$argType" = "age_pubkey" ]]; then if [[ "$argInput" =~ ^age1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]*$ ]]; then return 0; fi; fi @@ -47,7 +47,7 @@ testKey2="blah-blah onetwothreeREEE"; testKey3=""; testKey4="age1c3s6huz6en6jh40cem0erc0m2un2ry85my0t0ujj4a5cu8gzkysq9l39e4"; keyTypeA="ssh_pubkey"; -keyTypeB="bech32"; +keyTypeB="age_pubkey"; if validateInput "$testKey1" "$keyTypeA"; then echo "$testKey1 looks like a valid $keyTypeA."; else echo "$testKey1 doesn't look like a valid $keyTypeA."; fi if validateInput "$testKey2" "$keyTypeA"; then echo "$testKey2 looks like a valid $keyTypeA."; else echo "$testKey2 doesn't look like a valid $keyTypeA."; fi if validateInput "$testKey3" "$keyTypeA"; then echo "$testKey3 looks like a valid $keyTypeA."; else echo "$testKey3 doesn't look like a valid $keyTypeA."; fi