From d172439fac755df00994286997617b2e195b0507 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Fri, 2 Dec 2022 00:11:22 -0500 Subject: [PATCH] update aputils --- relay/http_client.py | 8 ++++---- relay/processors.py | 2 +- setup.cfg | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/relay/http_client.py b/relay/http_client.py index 4c82fa9..3b8a182 100644 --- a/relay/http_client.py +++ b/relay/http_client.py @@ -87,7 +87,7 @@ class HttpClient: headers = {} if sign_headers: - headers.update(self.database.signer.sign_headers('GET', url)) + headers.update(self.database.signer.sign_headers('GET', url, algorithm='original')) try: logging.verbose(f'Fetching resource: {url}') @@ -142,11 +142,11 @@ class HttpClient: instance = self.database.get_inbox(url) ## Using the old algo by default is probably a better idea right now - if instance and instance.get('software') not in {'mastodon'}: - algorithm = aputils.Algorithm.RSASHA256 + if instance and instance.get('software') in {'mastodon'}: + algorithm = 'hs2019' else: - algorithm = aputils.Algorithm.HS2019 + algorithm = 'original' headers = {'Content-Type': 'application/activity+json'} headers.update(self.database.signer.sign_headers('POST', url, message, algorithm=algorithm)) diff --git a/relay/processors.py b/relay/processors.py index 1af7ed0..2e2a977 100644 --- a/relay/processors.py +++ b/relay/processors.py @@ -23,7 +23,7 @@ async def handle_relay(request): cache[request.message.objectid] = message.id logging.debug(f'>> relay: {message}') - niboxes = request.database.distill_inboxes(request.message) + inboxes = request.database.distill_inboxes(request.message) for inbox in inboxes: request.app.push_message(inbox, message) diff --git a/setup.cfg b/setup.cfg index cc99d3b..da4201b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ install_requires = click >= 8.1.2 pycryptodome >= 3.14.1 PyYAML >= 5.0.0 - aputils @ https://git.barkshark.xyz/barkshark/aputils/archive/0.1.1.tar.gz + aputils @ https://git.barkshark.xyz/barkshark/aputils/archive/0.1.2.tar.gz python_requires = >=3.6 [options.extras_require]