Wykres commitów

162 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett e214bc0a43
ATProto firehose: more tests
for #978
2024-05-08 10:39:03 -07:00
Ryan Barrett 4da00192b0
when someone follows a bot user to opt in, have the bot user follow them back
fixes #999. this makes sure we start receiving posts from AP users immediately, instead of waiting until a Bluesky opted in user follows them.
2024-05-07 10:54:18 -07:00
Ryan Barrett 2bf526ab7c
refactor validating handles in ATProto and elsewhere
for https://github.com/snarfed/bridgy-fed/issues/982
2024-05-03 15:18:16 -07:00
Ryan Barrett f4a0c3deaa
fix tests for 7b3fa6e82b 2024-05-02 20:22:35 -07:00
Ryan Barrett b6be345921
UI: refactor actor link rendering into User.user_link / Object.actor_link 2024-04-29 12:27:00 -07:00
Ryan Barrett 853b4be142
ATroto.send: for flag activities, send createReport to mod service
for snarfed/granary#596. background:
* https://docs.bsky.app/docs/advanced-guides/moderation#reporting
* https://github.com/bluesky-social/atproto/discussions/2350#discussioncomment-8847613
* https://github.com/snarfed/granary/issues/596
2024-04-26 13:59:04 -07:00
Ryan Barrett 0238b46e36
add Protocol.HAS_COPIES, use to generate ids.COPIES_PROTOCOLS 2024-04-23 16:52:53 -07:00
Ryan Barrett c86c91b25b
User.enable_protocols bug fix: only call create_for for copy protocols
also add integration test for following protocol bot user from ATProto
2024-04-23 16:38:08 -07:00
Ryan Barrett 3f1d860bba
AP: add test for following bot user to enable protocol
also relax Web.put check on id to allow internal domains for bot users
2024-04-23 10:17:13 -07:00
Ryan Barrett c87e69d354
bug fix for ids.web_ap_base_domain
...and test it properly instead of mocking out the constant
2024-04-22 15:15:27 -07:00
Ryan Barrett 34692abc60
handle protocol bot users in webfinger, ids.translate_handle, Web.owns_handle
for #880
2024-04-22 14:01:09 -07:00
Ryan Barrett 18b1a33d22
testutil.setUp() noop tweak for adding Fake classes to common.*_DOMAINS 2024-04-21 16:22:33 -07:00
Ryan Barrett 10023d17fd
Protocol.enable_protocol: create copy user if necessary 2024-04-21 12:18:12 -07:00
Ryan Barrett 6b597c90c3
User.get_or_create: abstract propagate and create_for across protocols 2024-04-21 11:40:13 -07:00
Ryan Barrett 259b7d72dd
start on conditional opt in
* add Protocol.DEFAULT_ENABLED_PROTOCOLS
* add User.enabled_protocols
* move common.is_enabled to Protocol.is_enabled_to, include opt out/in
2024-04-17 16:43:10 -07:00
Ryan Barrett 817ef1d5d6
user pages: only hide indirect AP users, not ATProto 2024-04-11 14:24:18 -07:00
Ryan Barrett c1acec1a3f
clear did.resolve_* caches in tests
for snarfed/arroba@f95365d7c3
2024-04-10 15:20:28 -07:00
Ryan Barrett d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user 2024-02-28 12:07:06 -08:00
Ryan Barrett 9489204d64
AP: add profile to Content-Type: application/ld+json
for #895
2024-02-27 11:38:00 -08:00
Ryan Barrett 56a3c0e34b
bluesky: opt out users who have disabled logged out view on bsky.app
ie "Discourage apps from showing my account to logged-out users" on https://bsky.app/moderation

fixes #828

https://docs.bsky.app/docs/advanced-guides/resolving-identities#for-backend-services
https://github.com/bluesky-social/atproto/blob/main/packages/api/docs/labels.md#label-behaviors
2024-02-23 10:33:34 -08:00
Ryan Barrett fcef6c21ab
Revert "heuristic: assume no AP actor id is the root path on its host"
This reverts commit b7e890b4bb.

it was a nice idea, but we're now hitting AP actor ids that are the root path on their host. this is evidently how microblog.pub does AP; 0x3b0b's site https://bw3.dev/ is an example. general info on https://docs.microblog.pub/user_guide.html#activitypub but not this specifically.

fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-01-26 12:59:54 -08:00
Ryan Barrett 3bcef0d37d
follow UI: specific error message for trying to follow bridged accounts
thanks for the nudge @campegg!
2024-01-25 17:05:26 -08:00
Ryan Barrett 7941b632ca
Object._pre_put_hook: require that protocol owns id 2024-01-12 19:53:01 -08:00
Ryan Barrett 26de4097ae
AP: switch default signing actor to real fed.brid.gy instance actor
https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/#the-instance-actor
2024-01-06 11:59:31 -10:00
Ryan Barrett beb865bc07
web feed fetching: add next poll task
use average of time between posts in feed as ETA

for #550
2024-01-01 20:12:33 -10:00
Ryan Barrett e9a8d81d43
testutil noop: remove unused import 2023-12-29 21:00:08 -08:00
Ryan Barrett 2c19a5a3af
drop obsolete unwrap in Object.as1 when converting from as2 2023-12-02 14:25:38 -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 6091cd4063
drop the rest of g.user!
for #690
2023-11-25 20:38:28 -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 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 cbbea104fc
cache Protocol.for_id
fixes #727
2023-11-13 14:18:32 -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 00fb4dd14d
move test_atproto.KEY to testutil.ATPROTO_KEY 2023-11-13 14:08:21 -08:00
Ryan Barrett f97b837960
cache follower/following counts for 2h 2023-11-08 12:03:56 -08:00
Ryan Barrett 9327565095
/convert/: drop req't that ids are web URLs
for abstracting across protocols. also other minor tweaks.
2023-11-08 11:28:17 -08: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 c280a3f213
switch Protocol.translate_ids from using subdomain_wrap to translate_object_id 2023-10-26 17:18:01 -07:00
Ryan Barrett dc82fd02e1
TestCase.as2_req: support POSTs with data kwarg 2023-10-26 16:56:30 -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 acb1c703a3
rename Protocol.serve => .convert, move Content-Type to class constant 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 4faf551f8f
testutil: generate activitypub._DEFAULT_SIGNATURE_USER proactively 2023-10-19 13:09:19 -07:00
Ryan Barrett e486c28919
testutil noop, fix class names in Fake log messages 2023-10-18 11:03:22 -07:00
Ryan Barrett c1b07acfa5
cloud tasks only 2023-10-18 11:03:22 -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 7466a000a5
testutil: add assertLogs wrapper that enables/disables logs 2023-10-16 10:53:58 -07:00
Ryan Barrett f3039fc87a
Protocol.send: bring back log_data kwarg 2023-10-13 18:29:28 -07:00
Ryan Barrett 84e9b2bcfd
AP: strip @context from Object.as2 before storing in datastore
we don't do LD, and many other servers' @contexts are big, so this saves disk space.

fixes #426
2023-10-11 16:35:05 -07:00
Ryan Barrett cc62d4cdb1
user page redesign: feeds bug fix, fix tests 2023-10-11 12:25:38 -07:00