Improve debug mode

This commit is contained in:
Thomas Sileo 2022-08-28 11:24:46 +02:00
parent 09cdef118c
commit 333e367a5b
2 changed files with 3 additions and 1 deletions

View file

@ -130,6 +130,7 @@ async def _get_public_key(db_session: AsyncSession, key_id: str) -> Key:
k.load_pub(actor["publicKey"]["publicKeyPem"])
# Ensure the right key was fetch
# TODO: some server have the key ID `http://` but fetching it return `https`
if key_id not in [k.key_id(), k.owner]:
raise ValueError(
f"failed to fetch requested key {key_id}: got {actor['publicKey']}"