update aputils

This commit is contained in:
Izalia Mae 2022-12-02 00:11:22 -05:00
parent 1a7abb4ecb
commit d172439fac
3 changed files with 6 additions and 6 deletions

View file

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

View file

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

View file

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