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 <[email protected]>

* Update in_memory.py

Signed-off-by: Patrick St-Louis <[email protected]>

* linting

Signed-off-by: PatStLouis <[email protected]>

* apply better suggestion

Signed-off-by: PatStLouis <[email protected]>

* set empty tags object instead of none for consistency

Signed-off-by: PatStLouis <[email protected]>

* remove unnecessary change in the in memory wallet

Signed-off-by: PatStLouis <[email protected]>

---------

Signed-off-by: Patrick St-Louis <[email protected]>
Signed-off-by: PatStLouis <[email protected]>
  • Loading branch information
PatStLouis authored Sep 26, 2024
1 parent dc66c82 commit 9163871
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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,8 +192,10 @@ 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
kid = key.tags["kid"] if "kid" in key.tags else None
return KeyInfo(verkey=verkey, metadata=metadata, key_type=ED25519, kid=kid)

async def replace_signing_key_metadata(self, verkey: str, metadata: dict):
Expand Down

0 comments on commit 9163871

Please sign in to comment.