Skip to content

Commit

Permalink
Removed --alias from verify command. (#867)
Browse files Browse the repository at this point in the history
* Adjusted log message to clarify which SAID errored as SADs may contain multiple SAIDs

* Adjusted workflow to get right image to run

* Adjusted help descriptions to more accurately describe what that command does in keripy

* Restored these files to what they are in origin/main

* Removed --prefix from verify command.

Prefixes are 1-1 with aliases which are already required for this
command and thus redundant.  Removed for ease of use.

* Reverted to remove alias rather than prefix from verify command
  • Loading branch information
daidoji authored Nov 18, 2024
1 parent 4728272 commit 676d519
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions scripts/demo/basic/demo-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ isSuccess
kli sign --name test --base "${KERI_TEMP_DIR}" --alias trans --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json
isSuccess

kli verify --name test --base "${KERI_TEMP_DIR}" --alias trans --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature AABuQervAG8QLyvho99362U8TScec_4zYDVF1pUMWfWfKbl5thR6QakpvSvVMdcPcGYxi0McgNtW-Z3EhpC01I4A
kli verify --name test --base "${KERI_TEMP_DIR}" --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature AABuQervAG8QLyvho99362U8TScec_4zYDVF1pUMWfWfKbl5thR6QakpvSvVMdcPcGYxi0McgNtW-Z3EhpC01I4A
isSuccess

kli verify --name test --base "${KERI_TEMP_DIR}" --alias trans --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ABBJcS2ZbcHEdEEnaJE1CFUxdsKqkoU5TS34CImGh3s0cs-k3cNcy2PJxQ8WjIvAot1-cZ71o1E-WkqZ-tCTNZsJ
kli verify --name test --base "${KERI_TEMP_DIR}" --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ABBJcS2ZbcHEdEEnaJE1CFUxdsKqkoU5TS34CImGh3s0cs-k3cNcy2PJxQ8WjIvAot1-cZ71o1E-WkqZ-tCTNZsJ
isSuccess

kli verify --name test --base "${KERI_TEMP_DIR}" --alias trans --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ACBieMVQBXvIxeqQuHc4Db_-GUoFE9e37TW8t6DomwXdMcSxBiHJpDp3EJH1Dcz9lHKbFuCRqoNo4wywZGtUpOcB
kli verify --name test --base "${KERI_TEMP_DIR}" --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ACBieMVQBXvIxeqQuHc4Db_-GUoFE9e37TW8t6DomwXdMcSxBiHJpDp3EJH1Dcz9lHKbFuCRqoNo4wywZGtUpOcB
isSuccess

kli verify --name test --base "${KERI_TEMP_DIR}" --alias trans --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ACSHdal6kHAAjbW_frH83sDDCoBHw_nNKFysW5Dj8PSsnwVPePCNw-kFmF6Z8H87q7D3abw_5u2i4jmzdnWFsRDz
kli verify --name test --base "${KERI_TEMP_DIR}" --prefix EIryzWYlZ9bQr7EhMAoBXk4r2h-OgaEqERid7-AHNp6o --text @${KERI_DEMO_SCRIPT_DIR}/data/anchor.json --signature ACSHdal6kHAAjbW_frH83sDDCoBHw_nNKFysW5Dj8PSsnwVPePCNw-kFmF6Z8H87q7D3abw_5u2i4jmzdnWFsRDz
ret=$?
if [ $ret -eq 0 ]; then
echo "Testing invalid signature should fail $ret"
Expand Down
6 changes: 2 additions & 4 deletions src/keri/app/cli/commands/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True)
parser.add_argument('--base', '-b', help='additional optional prefix to file location of KERI keystore',
required=False, default="")
parser.add_argument('--alias', '-a', help='human readable alias for the new identifier prefix', required=True)
parser.add_argument('--passcode', '-p', help='21 character encryption passcode for keystore (is not saved)',
dest="bran", default=None) # passcode => bran

Expand Down Expand Up @@ -45,16 +44,15 @@ def verify(tymth, tock=0.0, **opts):
args = opts["args"]

name = args.name
alias = args.alias
base = args.base
bran = args.bran

sigers = [indexing.Siger(qb64=sig) for sig in args.signature]

try:
with existing.existingHab(name=name, alias=alias, base=base, bran=bran) as (_, hab):
with existing.existingHby(name=name, base=base, bran=bran) as hby:

kever = hab.kevers[args.prefix]
kever = hby.kevers[args.prefix]

txt = args.text
if txt.startswith("@"):
Expand Down
2 changes: 1 addition & 1 deletion tests/app/cli/test_kli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_standalone_kli_commands(helpers, capsys):
'3. '
'ACCLl9pVv7OM4Y261GZkpPWQu__1mw8ffzcFY1lJ62CGjiEh3mvESu_N7a01YOCKqicqEe5TOXSf0j_8qBxPKxwO\n')

args = parser.parse_args(["verify", "--name", "test", "--alias", "trans",
args = parser.parse_args(["verify", "--name", "test",
"--prefix",
'EF0bnfg4smFm9Q_OKlKUYRRQctGhTBWUU3rXf7zuA9GU',
"--text",
Expand Down

0 comments on commit 676d519

Please sign in to comment.