http signatures: handle fetch_actor_key failure more gracefully
This commit is contained in:
parent
42ad51e94a
commit
6e493ca9e1
|
@ -60,11 +60,14 @@ def sign_headers(headers, key, key_id):
|
||||||
async def fetch_actor_key(actor):
|
async def fetch_actor_key(actor):
|
||||||
actor_data = await fetch_actor(actor)
|
actor_data = await fetch_actor(actor)
|
||||||
|
|
||||||
|
if not actor_data:
|
||||||
|
return None
|
||||||
|
|
||||||
if 'publicKey' not in actor_data:
|
if 'publicKey' not in actor_data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if 'publicKeyPem' not in actor_data['publicKey']:
|
if 'publicKeyPem' not in actor_data['publicKey']:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return RSA.importKey(actor_data['publicKey']['publicKeyPem'])
|
return RSA.importKey(actor_data['publicKey']['publicKeyPem'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue