Unverified Commit 8083f787 authored by Agate's avatar Agate 💬

Fix #876: use proper http-signature release

parent 2fefe149
......@@ -20,11 +20,10 @@ class SignatureAuthFactory(factory.Factory):
algorithm = "rsa-sha256"
key = factory.LazyFunction(lambda: keys.get_key_pair()[0])
key_id = factory.Faker("url")
use_auth_header = False
headers = ["(request-target)", "user-agent", "host", "date", "accept"]
class Meta:
model = requests_http_signature.HTTPSignatureAuth
model = requests_http_signature.HTTPSignatureHeaderAuth
@registry.register(name="federation.SignedRequest")
......
......@@ -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"),
......
......@@ -58,7 +58,7 @@ gunicorn>=20.0.4,<20.1
cryptography>=2.8,<3
# requests-http-signature==0.0.3
# clone until the branch is merged and released upstream
git+https://github.com/EliotBerriot/requests-http-signature.git@signature-header-support
https://github.com/pyauth/requests-http-signature/archive/c0c8fd7255b73001845062f355c2f702bb2903db.zip
django-cleanup>=4,<4.1
requests>=2.22<2.23
pyOpenSSL>=19<20
......
Replaced forked http-signature dependency with official package (#876)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment