mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 15:29:22 +02:00
Use own requests-http-signing to be compatible with Signature header
This commit is contained in:
parent
7191a2a2c0
commit
c63b7f929d
4 changed files with 26 additions and 23 deletions
|
@ -5,7 +5,8 @@ import requests_http_signature
|
|||
def verify(request, public_key):
|
||||
return requests_http_signature.HTTPSignatureAuth.verify(
|
||||
request,
|
||||
key_resolver=lambda **kwargs: public_key
|
||||
key_resolver=lambda **kwargs: public_key,
|
||||
use_auth_header=False,
|
||||
)
|
||||
|
||||
|
||||
|
@ -20,7 +21,7 @@ def verify_django(django_request, public_key):
|
|||
# with requests_http_signature
|
||||
headers[h.lower()] = v
|
||||
try:
|
||||
signature = headers['authorization']
|
||||
signature = headers['signature']
|
||||
except KeyError:
|
||||
raise exceptions.MissingSignature
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue