mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 19:09:17 +02:00
Fix #876: use proper http-signature release
This commit is contained in:
parent
b91c48a6ce
commit
7f80a86bc5
4 changed files with 5 additions and 6 deletions
|
@ -46,7 +46,7 @@ def verify(request, public_key):
|
|||
verify_date(date)
|
||||
try:
|
||||
return requests_http_signature.HTTPSignatureAuth.verify(
|
||||
request, key_resolver=lambda **kwargs: public_key, use_auth_header=False
|
||||
request, key_resolver=lambda **kwargs: public_key, scheme="Signature"
|
||||
)
|
||||
except cryptography.exceptions.InvalidSignature:
|
||||
logger.warning(
|
||||
|
@ -98,8 +98,7 @@ def verify_django(django_request, public_key):
|
|||
|
||||
|
||||
def get_auth(private_key, private_key_id):
|
||||
return requests_http_signature.HTTPSignatureAuth(
|
||||
use_auth_header=False,
|
||||
return requests_http_signature.HTTPSignatureHeaderAuth(
|
||||
headers=["(request-target)", "user-agent", "host", "date"],
|
||||
algorithm="rsa-sha256",
|
||||
key=private_key.encode("utf-8"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue