Ryan Barrett
ee373095e2
send follow accepts to protocols that support them
...
for #710
2023-11-27 16:32:22 -08:00
Ryan Barrett
8f7facda97
don't automatically accept follows from protocols that support them natively
...
for #710 . adds per-protocol `HAS_FOLLOW_ACCEPTS` constant
2023-11-27 14:44:05 -08:00
Ryan Barrett
b81fa2090b
Protocol.receive: handle opted out users
2023-11-27 06:53:22 -08:00
Ryan Barrett
1591dfb641
pass user to Protocol.send/convert instead of using g.user
...
for #690
2023-11-25 20:07:14 -08:00
Ryan Barrett
e947891d75
Protocol.receive: fail if incoming activity doesn't have actor or author
...
for #690
2023-11-25 14:50:08 -08:00
Ryan Barrett
2c6a470058
drop g.user in lots of tests
...
for #690
2023-11-19 21:53:39 -08:00
Ryan Barrett
fefcbbb77e
drop Protocol.actor_key's default_g_user kwarg
...
for #690
2023-11-19 21:53:38 -08:00
Ryan Barrett
bee313fb67
drop User.atproto_did, switch to using copies
2023-11-15 19:08:06 -08:00
Ryan Barrett
4d095fa3d9
misc cleanup
...
* remove obsolete TODOs, commented out code
* remove obsolete circular imports of per-protocol modules
* minimize Object put in Protocol.load
* remove duplicated Protocol.load tests in test_activitypub
* re-enable rest of ActivityPubUtilsTest.test_postprocess_as2_idempotent
* drop default cls=Web in TestCase.make_user
2023-11-15 14:23:08 -08:00
Ryan Barrett
ac6f98f54c
integration test for #720
...
BF's first integration test! hopefully more to come, eg snarfed/bridgy-fed#689
actual fix is in snarfed/granary@3c782f9
2023-11-13 14:37:16 -08:00
Ryan Barrett
91c25f6955
testutil noop, TestCase.make_user: include source_protocol in profile Object
2023-11-13 14:08:21 -08:00
Ryan Barrett
12158eba64
Protocol.targets bug fix, handle composite inReplyTo
2023-11-13 14:08:21 -08:00
Ryan Barrett
0364ece4a8
stop resolving ids in Protocol.targets, since Protocol.receive already did it
2023-11-12 13:21:35 -08:00
Ryan Barrett
84324c0c0b
Protocol.targets: suppress mentions of in-reply-to authors
...
fixes #686
2023-11-10 14:39:40 -08:00
Ryan Barrett
fdc5b8e1e9
Protocol.translate_ids bug fix: handle create/update user profile activities
2023-11-03 15:10:05 -07:00
Ryan Barrett
def5638a64
Protocol.translate: distinguish between object and user ids
2023-11-02 13:08:24 -07:00
Ryan Barrett
c9a66cfc7c
test_protocol: test send task handler
2023-10-31 13:33:22 -07:00
Ryan Barrett
db646909e2
delivery: switch from threads to tasks, one per send
...
for #652
2023-10-31 12:49:27 -07:00
Ryan Barrett
b7e890b4bb
heuristic: assume no AP actor id is the root path on its host
...
this lets us assume home pages are Web users without making any network requests
2023-10-26 17:58:10 -07:00
Ryan Barrett
c280a3f213
switch Protocol.translate_ids from using subdomain_wrap to translate_object_id
2023-10-26 17:18:01 -07:00
Ryan Barrett
5843235fd1
rename ids.convert_id => translate_user_id, convert_handle => translate_handle
2023-10-26 13:53:31 -07:00
Ryan Barrett
f74be7b0e5
add Protocol.convert_wrap
2023-10-26 13:53:31 -07:00
Ryan Barrett
ca8b7484c0
drop User.as2, Object.as_as2, switch callers to Protocol.convert
2023-10-25 13:28:01 -07:00
Ryan Barrett
e833eb04dc
Object.resolve_ids: compact output objects with just id to bare string ids
2023-10-25 12:31:52 -07:00
Ryan Barrett
422a240183
Resolve protocol-subdomain-wrapped ids/URLs by stripping the subdomain wrapping
...
Renames Object.replace_copies_with_originals => resolve_ids. As a side effect, also fixes https://console.cloud.google.com/errors/detail/CK3U3PONxv5Q;time=P30D?project=bridgy-federated
2023-10-24 10:47:44 -07:00
Ryan Barrett
d12fd99b03
noop: move Protocol.subdomain_url to common.subdomain_wrap
2023-10-23 15:44:32 -07:00
Ryan Barrett
39c0d0e734
atproto: hard code our PDS URL to atproto.brid.gy
...
even on localhost
2023-10-20 11:16:23 -07:00
Ryan Barrett
89cd73831b
rework g.user
...
* it's always sending user ie actor
* don't pass it to task from atproto.poll_notifications (we were incorrectly passing the receiving user)
* in Protocol.receive, default g.user to actor/author
* in ActivityPub.signed_request, if g.user is ActivityPub, it won't have AP keys, so use default signing user instead
kinda scary and iffy. 🤞 🤞 🤞
2023-10-18 13:56:53 -07:00
Ryan Barrett
9e1acf1cf7
replace copy ids with originals in Protocol.load
...
honestly not sure if this is necessary yet, and it's moderately expensive, two serial datastore queries with an IN filter. we'll see.
2023-10-18 11:18:20 -07:00
Ryan Barrett
efdf84a023
Protocol.receive: replace copy ids with originals, related bug fixes
2023-10-18 11:03:22 -07:00
Ryan Barrett
c1b07acfa5
cloud tasks only
2023-10-18 11:03:22 -07:00
Ryan Barrett
96b84511eb
add Object.replace_copies_with_originals
2023-10-18 11:03:22 -07:00
Ryan Barrett
b8c7d1cd96
receive_task: set object.new to force receive to process it
2023-10-18 11:03:21 -07:00
Ryan Barrett
325ba64c66
authorization: block external requests to cloud task handlers
...
...by checking for a GAE Cloud Tasks header: https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_task_request_headers
2023-10-16 13:04:34 -07:00
Ryan Barrett
db3a5e7fd6
authorization: pass and accept authed_as in receive task handler
...
for #566
2023-10-16 12:45:27 -07:00
Ryan Barrett
c83c77a73e
authorization: log when authed user doesn't match activity's author/actor
...
for #566 . just logging for now, want to see if we're already hitting this at all.
2023-10-16 11:13:38 -07:00
Ryan Barrett
55c8d9bec6
authorization: log updates, deletes, creates from the wrong actor
...
for #566 . just logging for now, want to see if we're already hitting this at all.
2023-10-16 06:37:52 -07:00
Ryan Barrett
f3039fc87a
Protocol.send: bring back log_data kwarg
2023-10-13 18:29:28 -07:00
Ryan Barrett
d0da119b07
add opt out via #nobridge or #nobot text in user profile bio
...
fixes #666
(unfortunate issue number 😆 )
2023-10-13 12:36:31 -07:00
Ryan Barrett
5bf081afdb
make Protocol/Web.key_for() follow use_instead
...
fixes #662 . probably more to do here eventually though, eg #665 .
2023-10-10 09:58:07 -07:00
Ryan Barrett
59abcb00bc
Protocol.send: drop log_data kwarg
...
protocols are responsible for logging objects themselves
2023-10-07 12:54:32 -07:00
Ryan Barrett
7e7962fe45
add orig_obj kwarg to Protocol.send
2023-10-07 12:49:39 -07:00
Ryan Barrett
4909c0814e
deliver self-replies to all followers
...
fixes #639
2023-10-06 14:59:47 -07:00
Ryan Barrett
e89730e68f
drop /_ah/ path prefix on task handlers
...
...since it's not supported in dispatch.yaml: https://cloud.google.com/appengine/docs/flexible/reference/dispatch-yaml?tab=python#url
2023-09-29 13:49:17 -07:00
Ryan Barrett
01d3b67bed
add Protocol.for_handle
2023-09-29 11:32:28 -07:00
Ryan Barrett
a823dd1d65
use protocol subdomains in AP inbox
...
...and other misc protocol subdomain fixes
2023-09-27 13:55:16 -07:00
Ryan Barrett
771de9770e
AP inbox bug fix: handle Like with null object
...
fixes https://console.cloud.google.com/errors/detail/CIiI9b-nz7-bIA;time=P30D?project=bridgy-federated
2023-09-27 09:43:16 -07:00
Ryan Barrett
ad0a942034
switch webfinger and AP actors to mostly protocol subdomains
...
except Web, it still mostly serves on fed.brid.gy for backcompat, don't want to change existing Web users' AP actor ids.
2023-09-26 16:43:48 -07:00
Ryan Barrett
e9e8827ef9
standardize more on 'handle' and 'id' terms
...
* User.readable_id => handle
* User.readable_or_key_id => handle_or_id
2023-09-25 12:33:24 -07:00
Ryan Barrett
6a6a1657a7
rename Protocol.for_domain => for_bridgy_subdomain
2023-09-22 11:55:46 -07:00