Skip to content

Commit

Permalink
[BUG] Handle get key operation when no tag has been set (#3256)
Browse files Browse the repository at this point in the history
* 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 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.