mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 21:24:28 +00:00
Tweak HTTP sig key fetching
This commit is contained in:
parent
c6bc53ce54
commit
339757ebd2
1 changed files with 2 additions and 2 deletions
|
@ -100,9 +100,9 @@ async def _get_public_key(db_session: AsyncSession, key_id: str) -> Key:
|
||||||
k.load_pub(actor["publicKey"]["publicKeyPem"])
|
k.load_pub(actor["publicKey"]["publicKeyPem"])
|
||||||
|
|
||||||
# Ensure the right key was fetch
|
# Ensure the right key was fetch
|
||||||
if key_id != k.key_id():
|
if key_id not in [k.key_id(), k.owner]:
|
||||||
raise ValueError(
|
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
|
_KEY_CACHE[key_id] = k
|
||||||
|
|
Loading…
Reference in a new issue