Re-add the HTTP sig check in the right place

master
Thomas Sileo 2019-04-18 00:48:08 +02:00
rodzic 22b1e7fd0a
commit 4bd79c0ea9
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -65,6 +65,11 @@ def _get_public_key(key_id: str) -> Key:
actor = get_backend().fetch_iri(key_id)
k = Key(actor["id"], key_id)
k.load_pub(actor["publicKey"]["publicKeyPem"])
# Ensure the right key was fetch
if key_id != actor["publicKey"]["id"]:
raise ValueError(f"failed to fetch requested key {key_id}: got {actor['publicKey']['id']}")
return k