From 339757ebd29bc08bd9714f4c2e1efb97196ee85a Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 10 Jul 2022 19:29:36 +0200 Subject: [PATCH] Tweak HTTP sig key fetching --- app/httpsig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/httpsig.py b/app/httpsig.py index 6a4194e..bce718b 100644 --- a/app/httpsig.py +++ b/app/httpsig.py @@ -100,9 +100,9 @@ async def _get_public_key(db_session: AsyncSession, key_id: str) -> Key: k.load_pub(actor["publicKey"]["publicKeyPem"]) # Ensure the right key was fetch - if key_id != k.key_id(): + if key_id not in [k.key_id(), k.owner]: raise ValueError( - f"failed to fetch requested key {key_id}: got {actor['publicKey']['id']}" + f"failed to fetch requested key {key_id}: got {actor['publicKey']}" ) _KEY_CACHE[key_id] = k