Use own requests-http-signing to be compatible with Signature header

This commit is contained in:
Eliot Berriot 2018-03-30 21:59:58 +02:00
parent 7191a2a2c0
commit c63b7f929d
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 26 additions and 23 deletions

View file

@ -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