Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Handle get key operation when no tag has been set #3256

Merged
merged 6 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion aries_cloudagent/wallet/askar.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,14 @@ async def get_signing_key(self, verkey: str) -> KeyInfo:
if not key:
raise WalletNotFoundError("Unknown key: {}".format(verkey))
metadata = json.loads(key.metadata or "{}")

# Provisioned keys don't get tags by default
try:
kid = key.tags["kid"] if "kid" in key.tags else None
jamshale marked this conversation as resolved.
Show resolved Hide resolved
except Exception:
kid = None

# 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
2 changes: 1 addition & 1 deletion aries_cloudagent/wallet/in_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async def get_signing_key(self, verkey: str) -> KeyInfo:
verkey=key["verkey"],
metadata=key["metadata"].copy(),
key_type=key["key_type"],
kid=key["kid"],
kid=key["kid"] if "kid" in key else None,
)

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