Tweak HTTP sig key fetching

This commit is contained in:
Thomas Sileo 2022-07-10 19:29:36 +02:00
parent c6bc53ce54
commit 339757ebd2

View file

@ -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