From e44108f34135b85f43cae79252f45237907fba55 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 12 Jun 2024 16:02:59 -0400 Subject: [PATCH] update dependencies --- pyproject.toml | 23 ++++++++++++----------- relay/__init__.py | 2 +- relay/http_client.py | 16 +++++++++------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d9615e0..cf51b84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,19 +16,20 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] dependencies = [ - "activitypub-utils == 0.2.2", - "aiohttp >= 3.9.1", + "activitypub-utils == 0.3.0", + "aiohttp >= 3.9.5", "aiohttp-swagger[performance] == 1.0.16", "argon2-cffi == 23.1.0", - "barkshark-sql == 0.1.2", + "barkshark-lib >= 0.1.3", + "barkshark-sql == 0.1.4-1", "click >= 8.1.2", "hiredis == 2.3.2", "jinja2-haml == 0.3.5", - "markdown == 3.5.2", - "platformdirs == 4.2.0", + "markdown == 3.6", + "platformdirs == 4.2.2", "pyyaml >= 6.0", - "redis == 5.0.1", - "importlib_resources == 6.1.1; python_version < '3.9'" + "redis == 5.0.5", + "importlib-resources == 6.4.0; python_version < '3.9'" ] requires-python = ">=3.8" dynamic = ["version"] @@ -48,10 +49,10 @@ activityrelay = "relay.manage:main" [project.optional-dependencies] dev = [ "flake8 == 7.0.0", - "mypy == 1.9.0", - "pyinstaller == 6.3.0", - "watchdog == 4.0.0", - "typing_extensions >= 4.10.0; python_version < '3.11.0'" + "mypy == 1.10.0", + "pyinstaller == 6.8.0", + "watchdog == 4.0.1", + "typing-extensions >= 4.12.2; python_version < '3.11.0'" ] [tool.setuptools] diff --git a/relay/__init__.py b/relay/__init__.py index e1424ed..73e3bb4 100644 --- a/relay/__init__.py +++ b/relay/__init__.py @@ -1 +1 @@ -__version__ = '0.3.1' +__version__ = '0.3.2' diff --git a/relay/http_client.py b/relay/http_client.py index dcb575c..c4d9da0 100644 --- a/relay/http_client.py +++ b/relay/http_client.py @@ -7,7 +7,8 @@ import typing from aiohttp import ClientSession, ClientTimeout, TCPConnector from aiohttp.client_exceptions import ClientConnectionError, ClientSSLError from asyncio.exceptions import TimeoutError as AsyncTimeoutError -from aputils import AlgorithmType, JsonBase, Nodeinfo, ObjectType, WellKnownNodeinfo +from aputils import AlgorithmType, Nodeinfo, ObjectType, WellKnownNodeinfo +from blib import JsonBase from json.decoder import JSONDecodeError from urllib.parse import urlparse @@ -166,7 +167,7 @@ class HttpClient: old_algo: bool = True) -> T | None: if not issubclass(cls, JsonBase): - raise TypeError('cls must be a sub-class of "aputils.JsonBase"') + raise TypeError('cls must be a sub-class of "blib.JsonBase"') if (data := (await self._get(url, sign_headers, force, old_algo))) is None: return None @@ -178,12 +179,13 @@ class HttpClient: if not self._session: raise RuntimeError('Client not open') + # there seems to be a problem with HS2019, so defaulting to RSASHA256 for now # akkoma and pleroma do not support HS2019 and other software still needs to be tested - if instance and instance['software'] in {'mastodon'}: - algorithm = AlgorithmType.HS2019 + # if instance and instance['software'] in {'mastodon'}: + # algorithm = AlgorithmType.HS2019 - else: - algorithm = AlgorithmType.RSASHA256 + # else: + # algorithm = AlgorithmType.RSASHA256 body: bytes message: Message @@ -202,7 +204,7 @@ class HttpClient: url, body, headers = {'Content-Type': 'application/activity+json'}, - algorithm = algorithm + algorithm = AlgorithmType.RSASHA256 ) try: