mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 06:27:59 +00:00
update aputils
This commit is contained in:
parent
1a7abb4ecb
commit
d172439fac
|
@ -87,7 +87,7 @@ class HttpClient:
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
if sign_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:
|
try:
|
||||||
logging.verbose(f'Fetching resource: {url}')
|
logging.verbose(f'Fetching resource: {url}')
|
||||||
|
@ -142,11 +142,11 @@ class HttpClient:
|
||||||
instance = self.database.get_inbox(url)
|
instance = self.database.get_inbox(url)
|
||||||
|
|
||||||
## Using the old algo by default is probably a better idea right now
|
## Using the old algo by default is probably a better idea right now
|
||||||
if instance and instance.get('software') not in {'mastodon'}:
|
if instance and instance.get('software') in {'mastodon'}:
|
||||||
algorithm = aputils.Algorithm.RSASHA256
|
algorithm = 'hs2019'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
algorithm = aputils.Algorithm.HS2019
|
algorithm = 'original'
|
||||||
|
|
||||||
headers = {'Content-Type': 'application/activity+json'}
|
headers = {'Content-Type': 'application/activity+json'}
|
||||||
headers.update(self.database.signer.sign_headers('POST', url, message, algorithm=algorithm))
|
headers.update(self.database.signer.sign_headers('POST', url, message, algorithm=algorithm))
|
||||||
|
|
|
@ -23,7 +23,7 @@ async def handle_relay(request):
|
||||||
cache[request.message.objectid] = message.id
|
cache[request.message.objectid] = message.id
|
||||||
logging.debug(f'>> relay: {message}')
|
logging.debug(f'>> relay: {message}')
|
||||||
|
|
||||||
niboxes = request.database.distill_inboxes(request.message)
|
inboxes = request.database.distill_inboxes(request.message)
|
||||||
|
|
||||||
for inbox in inboxes:
|
for inbox in inboxes:
|
||||||
request.app.push_message(inbox, message)
|
request.app.push_message(inbox, message)
|
||||||
|
|
|
@ -28,7 +28,7 @@ install_requires =
|
||||||
click >= 8.1.2
|
click >= 8.1.2
|
||||||
pycryptodome >= 3.14.1
|
pycryptodome >= 3.14.1
|
||||||
PyYAML >= 5.0.0
|
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
|
python_requires = >=3.6
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
|
|
Loading…
Reference in a new issue