Skip to content

Commit

Permalink
[BUG] Handle get key operation when no tag has been set (openwallet-f…
Browse files Browse the repository at this point in the history
…oundation#3256)

* Bug-fix

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>

* Update in_memory.py

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>

* linting

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* apply better suggestion

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* set empty tags object instead of none for consistency

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* remove unnecessary change in the in memory wallet

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

---------

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>
Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
  • Loading branch information
PatStLouis authored and ff137 committed Oct 22, 2024
1 parent 1665c6a commit 751497b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aries_cloudagent/wallet/askar.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def create_key(
if kid:
tags = {"kid": kid}
else:
tags = None
tags = {}

try:
keypair = _create_keypair(key_type, seed)
Expand Down Expand Up @@ -192,6 +192,9 @@ async def get_signing_key(self, verkey: str) -> KeyInfo:
if not key:
raise WalletNotFoundError("Unknown key: {}".format(verkey))
metadata = json.loads(key.metadata or "{}")

kid = key.tags.get("kid")

# FIXME implement key types
try:
kid = key.tags["kid"] if "kid" in key.tags else None
Expand Down

0 comments on commit 751497b

Please sign in to comment.