kopia lustrzana https://github.com/snarfed/bridgy-fed
Protocol.receive: drop fed.brid.gy domain check
this happens after protocols pre-process objects and eg fill in BF AP actor ids. moved this check to *.send and user entity pre post hooks instead. for #597pull/598/head
rodzic
9a7597b365
commit
c3f9c56c31
|
@ -375,14 +375,6 @@ class Protocol:
|
|||
if not id:
|
||||
error('No id provided')
|
||||
|
||||
# block intra-BF ids
|
||||
if util.domain_from_link(id) in common.DOMAINS:
|
||||
error(f'{id} is on a Bridgy Fed domain, which is not supported')
|
||||
for field in 'id', 'actor', 'author', 'attributedTo':
|
||||
val = as1.get_object(obj.as1, field).get('id')
|
||||
if util.domain_from_link(val) in common.DOMAINS:
|
||||
error(f'{field} {val} is on Bridgy Fed, which is not supported')
|
||||
|
||||
# short circuit if we've already seen this activity id.
|
||||
# (don't do this for bare objects since we need to check further down
|
||||
# whether they've been updated since we saw them last.)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""Unit tests for protocol.py."""
|
||||
from unittest import skip
|
||||
from unittest.mock import patch
|
||||
|
||||
from flask import g
|
||||
|
@ -1074,6 +1075,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
self.assertEqual('fake:stop-following', obj.key.id())
|
||||
self.assertEqual('fake:user:target', target)
|
||||
|
||||
@skip
|
||||
def test_receive_from_bridgy_fed_domain_fails(self):
|
||||
with self.assertRaises(BadRequest):
|
||||
Fake.receive({
|
||||
|
|
Ładowanie…
Reference in New Issue