Wykres commitów

991 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett c816be48ba
ids.translate_handle: add enhanced kwarg
for #551
2023-11-29 16:41:09 -08:00
Ryan Barrett e079cec77c
ActivityPub.convert: omit acct: URIs
for #738, https://github.com/Automattic/wordpress-activitypub/issues/571
2023-11-29 14:51:56 -08:00
Ryan Barrett 911814dba2
Web.fetch: use util.parse_mf2's new metaformats support 2023-11-29 13:21:13 -08:00
Ryan Barrett 18f79d2626
Web: start adding metaformats support
for #551
2023-11-29 12:00:48 -08:00
Ryan Barrett aaf115347e
add manual opt-out list 2023-11-29 10:25:45 -08:00
Ryan Barrett 62ca4022fb
stop clearing Object data properties
...so that we have original data preserved when we override it in our_as1. fixes #721
2023-11-28 06:39:34 -08:00
Ryan Barrett 1ec1fc2482
genericize user handles on UI follower/following pages 2023-11-27 21:40:01 -08:00
Ryan Barrett 004726d397
fix followers/ing UI page for AP users
fixes #718
2023-11-27 21:01:02 -08:00
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 443506c425
activitypub.postprocess_as2_actor: remove obsolete wrap kwarg 2023-11-27 11:51:52 -08:00
Ryan Barrett 8f0d2d8650
AP: handle opted out users in following/ers, outbox collections 2023-11-27 11:32:30 -08:00
Ryan Barrett fe8b710cce
User.get_by_id: handle opt-out 2023-11-27 11:28:05 -08:00
Ryan Barrett b81fa2090b
Protocol.receive: handle opted out users 2023-11-27 06:53:22 -08:00
Ryan Barrett dd62f472da
User.get_or_create: return None if opted out 2023-11-27 06:53:22 -08:00
Ryan Barrett d79e2badf4
fix tests for dc3b23f80b 2023-11-26 21:39:31 -08:00
Ryan Barrett dc3b23f80b
Web.fetch: ignore uid if set; we use URL as id
props and thanks to @fluffy-critter for being my unintentional edge case QA department 😆🙏

fixes https://console.cloud.google.com/errors/detail/CKLuk-v4x8X0NQ;time=P30D?project=bridgy-federated
2023-11-26 16:31:29 -08:00
Ryan Barrett d7d55864ad
activitypub.actor bug fix: handle opted out users
fixes https://console.cloud.google.com/errors/detail/CKOs59zx0rSXQg;time=P30D?project=bridgy-federated
2023-11-26 15:44:43 -08:00
Ryan Barrett fae7769d2b
Web.get_or_create bug fix: handle opted out users
fixes https://console.cloud.google.com/errors/detail/CJ2U0_Hq6cHnUA;time=P30D?project=bridgy-federated
2023-11-26 15:37:39 -08:00
Ryan Barrett 6091cd4063
drop the rest of g.user!
for #690
2023-11-25 20:38:28 -08:00
Ryan Barrett 03315891aa
drop a lot of g.user
for #690
2023-11-25 20:23:19 -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 69ac7eabca
activitypub: move postprocess_as2_actor out of postprocess_as2
...and into ActivityPub.convert and actor handler directly. for #690
2023-11-24 09:20:52 -08:00
Ryan Barrett ee571e5b25
activitypub: move compacting actors from postprocess_as2 to convert
for #690
2023-11-24 08:34:39 -08:00
Ryan Barrett 33c5c3a4d2
AP: add HEAD support to followers/ing, outbox collections
for #383
2023-11-23 22:41:52 -08:00
Ryan Barrett 579f55d965
AP: add paging to outbox
finishes / fixes #383
2023-11-23 22:35:38 -08:00
Ryan Barrett db2668ffab
activitypub.postprocess_as2_actor: handle user without handle
fixes https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:11 -08:00
Ryan Barrett dcd7081d48
activitypub.actor: remove redundant preferredUsername
no clue why this triggered these flaky test failures, they happened when I ran all tests, but not test_pages on its own. grr.
2023-11-23 22:09:11 -08:00
Ryan Barrett f27e914a89
User.handle_as: handle when handle isn't set
for https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:05 -08:00
Ryan Barrett e5abdc097f
implement outbox
only first page. for #383
2023-11-22 21:40:36 -08:00
Ryan Barrett 48f89cebc0
User.handle_as: handle web users with custom usernames
bug fix for b255962, fixes https://console.cloud.google.com/errors/detail/CPiAj72alvDYNQ;time=P30D?project=bridgy-federated
2023-11-22 19:00:02 -08:00
Ryan Barrett f6af56f1c4
test_activitypub: use our_as1 for test web user, not as2 2023-11-22 17:59:18 -08:00
Ryan Barrett b255962fde
activitypub: genericize preferredUsername across protocols 2023-11-22 17:24:08 -08:00
Ryan Barrett 9b67d5273f
remove g.user in a few more places in activitypub
for #690
2023-11-20 16:21:20 -08:00
Ryan Barrett c593a80ee9
fix test_integrations for g.user minimizing in #690 2023-11-19 21:53:39 -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 507cb19c32
test_integrations: import test_web instead of WebTest to avoid duplicating
before this, unittest thought the imported WebTest was a new test class and ran it again.
2023-11-15 12:40:59 -08:00
Ryan Barrett d237d9611c
atproto: store extra `cid` field in Object.bsky, populate in record strongRefs 2023-11-14 19:24:37 -08:00
Ryan Barrett 95631396b7
atproto: fill in createdAt
for snarfed/granary@a0795b8c34
2023-11-14 15:24:51 -08:00
Ryan Barrett 81838df113
atproto.poll_posts: store record, not #postView 2023-11-14 14:21:22 -08:00
Ryan Barrett a5b5078729
ATProto: first pass at polling posts (timelines)
for #694
2023-11-14 12:30:14 -08:00
Ryan Barrett 9c5adab4f4
ATProto.send: support likes, reposts, follows
snarfed/bridgy-fed#717
2023-11-14 10:56:52 -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 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 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 3d0c5ecea5
Object.resolve_ids: handle multiple inReplyTo 2023-11-12 13:15:08 -08:00
Ryan Barrett a08a76c672
Object.resolve_ids bug fix: handle both protocol LABEL and ABBREV 2023-11-12 10:33:08 -08:00
Ryan Barrett 2a7c0adf0f
bug fixes for suppressing mentions of in-reply-to-authors
for 84324c0c0b, #686
2023-11-11 14:52:21 -08:00
Ryan Barrett 3975c143d7
fix atproto tests for arroba TID bug fixes in c8e6b30, 7170bf7 2023-11-11 10:38:48 -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 535494f21b
Object.to_as1 from bsky: pass at:// uri so we get id/url more often
for #715
2023-11-09 20:50:48 -08:00
Ryan Barrett 2be1229488
ATProto.send: store copy id in base object 2023-11-09 14:09:45 -08:00
Ryan Barrett f97b837960
cache follower/following counts for 2h 2023-11-08 12:03:56 -08:00
Ryan Barrett d576d2b2e4
move pages.count_followers to User, use it in activitypub.actor 2023-11-08 11:56:01 -08:00
Ryan Barrett 242a4a3ad3
fix activitypub actor tests for ae2cb2825b 2023-11-08 11:53:32 -08:00
Ryan Barrett d2dee8752f
/convert/: if dest protocol is AP, don't assume source protocol is Web 2023-11-08 11:28:17 -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 4b7926b3a8
/convert/: drop protocol regexps in URL path routes 2023-11-08 11:28:17 -08:00
Ryan Barrett bca034c4f8
ids: use subdomain-wrapped URLs to convert ATProto to Web/AP 2023-11-06 20:17:23 -08:00
Ryan Barrett 98bb29b333
drop Object.proxy_url, switch callers to ids.translate_object_id 2023-11-06 12:18:11 -08:00
Ryan Barrett 06275324fd
Web.convert: call translate_ids 2023-11-03 15:52:37 -07:00
Ryan Barrett aa5c6a396e
ActivityPub: translate ids in convert 2023-11-03 15:11:21 -07: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 cada99e407
ids.translate_user_id: follow use_instead 2023-11-03 14:53:19 -07:00
Ryan Barrett 6410d0ef1a
ids.translate_object_id: special case Web => AP
also preserve local hosts
2023-11-03 11:37:36 -07:00
Ryan Barrett 37d8b5d4fc
ids.translate_user_id: for Web, normalize home page URLs to domains 2023-11-03 11:00:34 -07:00
Ryan Barrett 1f6a227aee
Object.actor_link bug fix: handle composite url field
fixes https://console.cloud.google.com/errors/detail/CJTXq6ri48XtKQ;time=P30D?project=bridgy-federated
2023-11-03 06:53:33 -07:00
Ryan Barrett 625eb66d53
AP actor ids: redirect web and fed.brid.gy/ap/[domain] to fed.brid.gy/[domain] 2023-11-03 06:53:33 -07:00
Ryan Barrett 0725b72812
ids.translate_user_id: special case Web => AP to fed.brid.gy/domain 2023-11-03 06:53:33 -07:00
Ryan Barrett 4d44363693
fold Object.as_bsky into ATProto.convert, translate ids 2023-11-02 17:41:31 -07:00
Ryan Barrett def5638a64
Protocol.translate: distinguish between object and user ids 2023-11-02 13:08:24 -07:00
Ryan Barrett 72e180f854
User/Object.get_copy: return key id if proto is the source protocol 2023-11-02 13:08:23 -07:00
Ryan Barrett 0ca49e837a
add Object.get_copy, User.get_copy 2023-11-02 13:08:23 -07:00
Ryan Barrett 9aff3122c0
noop: rename get_for_copy[ies] => get_for_original[s] 2023-11-02 13:08:23 -07:00
Ryan Barrett 02e8208e32
test_atproto: noop, did:plc:foo => did:plc:user 2023-11-02 13:08:23 -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 8e4e95914d
test_ids: remove unnecessary test for translate_object_id 2023-10-26 17:03:14 -07:00
Ryan Barrett dc82fd02e1
TestCase.as2_req: support POSTs with data kwarg 2023-10-26 16:56:30 -07:00
Ryan Barrett c5959e00f4
add ids.translate_object_id 2023-10-26 16:20:30 -07:00
Ryan Barrett cfbfba654e
move User.get_for_copy/ies to module level, add Object results 2023-10-26 16:00:03 -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 43424259a5
noop: use as2.PUBLIC_AUDIENCE more in test_activitypub 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 acb1c703a3
rename Protocol.serve => .convert, move Content-Type to class constant 2023-10-25 12:31:52 -07:00
Ryan Barrett 6a867ca2c4
update for granary.as2's new PropertyValue attachment handling
snarfed/granary@20d6c3f065
2023-10-24 16:02:16 -07:00
Ryan Barrett 5a07e154ef
use subdomain_wrap in ids.convert 2023-10-24 15:58:03 -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 9a87d7261f
fix crash on RSS/Atom feeds for users without obj or obj.as1
fixes https://console.cloud.google.com/errors/detail/CKSZq8OU-tCRXA;time=P30D?project=bridgy-federated
2023-10-23 13:11:40 -07:00
Ryan Barrett 158200d9fd
bug fix for opt out, handle HTML 2023-10-21 20:51:54 -07:00
Ryan Barrett b32045d494
postprocess_as2: duplicate content into contentMap.en
for #681. this suppresses Mastodon's Translate link. longer term "right" fix is to actually detect the source's language, if available, and use it instead.
2023-10-20 13:37:54 -07:00
Ryan Barrett 1fa205af30
User.get_or_create: only fetch user profile if we don't already have it 2023-10-20 11:23:43 -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 d31f470178
Web.is_web_url: ignore www subdomain
for 3b88b0f
2023-10-19 16:25:04 -07:00
Ryan Barrett 3b88b0f315
AP: don't create "receiving" user in inbox, don't set actor to g.user in send
more iffy kinda scary changes. gulp. important though, baby step toward killing g.user! #690
2023-10-19 16:15:40 -07:00
Ryan Barrett fe3a9b693c
User.get_or_create: load user profile object, fetch if it doesn't exist 2023-10-19 15:01:19 -07:00
Ryan Barrett 4faf551f8f
testutil: generate activitypub._DEFAULT_SIGNATURE_USER proactively 2023-10-19 13:09:19 -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 7e3613ab6c
fix ATProto.target_for: it should always return our base URL as the PDS 2023-10-18 12:01:17 -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 d7a51916ad
/r/ redirect: handle bad URLs
fixes https://console.cloud.google.com/errors/detail/CJ30oPbsoqmI7QE;time=P30D?project=bridgy-federated
2023-10-18 11:03:22 -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 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 ff88c082ef
try not clearing Object.bsky
now that we're starting to replace copies with originals in ids, actors, etc, it'd be nice to preserve the original source object data.
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 4a3607325f
canonicalize domain: redirect UI requests on other domains to fed.brid.gy 2023-10-16 14:02:17 -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 f292a7d957
authorization: allow actor to update/delete itself
for #566
2023-10-16 12:25:29 -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 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 2d8fb1f57f
webfinger: handle unknown protocol subdomain 2023-10-12 17:55:44 -07:00
Ryan Barrett 9808bed1b4
ActivityPub.postprocess_as2: add Mention tags to cc 2023-10-12 16:22:57 -07:00
Ryan Barrett d2e6dd18c2
/convert: on localhost, serve two-protocol paths instead of redirecting 2023-10-12 16:22:56 -07:00
Ryan Barrett 215578f33f
render notifications feeds as snippets, not whole activities 2023-10-12 10:40:55 -07:00
Ryan Barrett ff168231d6
Object.actor_link: add image kwarg 2023-10-12 10:37:22 -07:00
Ryan Barrett 8f4c353936
Object.actor_link: add sized kwarg 2023-10-12 10:19:59 -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 15a325c928
AP: compact outgoing actor, author, and attributedTo fields to string ids
hope this improves compatibility with many other AP implementations that choke on objects instead of ids. fixes #658
2023-10-11 16:17:43 -07:00
Ryan Barrett dfab9f55d1
user page redesign: Object.actor_link: load actor from datastore
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett bd19cab870
Object.actor_link bug fix: handle actor/author objects with only id field
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett b1b2478b66
user page redesign: add notifications feeds, other minor tweaks
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett f37baeba58
user page redesign: misc tweaks
* separate source protocol from user in user labels
* make bridged protocol labels generic
* other visual tweaks

for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett cc62d4cdb1
user page redesign: feeds bug fix, fix tests 2023-10-11 12:25:38 -07:00
Ryan Barrett c1e0a08f72
user page redesign: add home, notifications pages
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett afa16d3864
start redesigning user pages
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett 1b78e86e6c
add Protocol.LOGO_HTML constant, change user page to link to external user
for #442
2023-10-11 12:25:38 -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 d5499acaf3
AP: parallelize inbox delivery with a thread pool
fixes #652. this should make inbox deliveries roughly 10x faster.
2023-10-07 15:08:02 -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 37188f3cca
User.get_or_create: if propagate=True, always reload user profile remotely 2023-10-07 11:51:21 -07:00
Ryan Barrett 4909c0814e
deliver self-replies to all followers
fixes #639
2023-10-06 14:59:47 -07:00
Ryan Barrett db29ad7757
docs: fix docstring formatting, other tweaks 2023-10-05 23:32:31 -07:00
Ryan Barrett 6442acb244
/bridge-user flashed message, link user handle 2023-10-05 22:28:36 -07:00
Ryan Barrett e00a4b52ba
ATProto: don't create DNS records if DEBUG is on 2023-10-05 15:55:31 -07:00
Ryan Barrett 7d8b1ba2e8
add fetch_blobs kwarg to Object.as_bsky 2023-10-05 15:47:04 -07:00
Ryan Barrett 000b08f9b2
when creating a new ATProto user, add a DNS _atproto TXT record for their handle 2023-10-04 13:54:20 -07:00
Ryan Barrett e96ab4654f
move creating ATProto users from User.get_or_create to new ATProto.create_for 2023-10-04 12:44:14 -07:00
Ryan Barrett ae25baba8c
drop obsolete User.href, it was only for OStatus
🫗
2023-10-04 12:30:20 -07:00
Ryan Barrett b4d5ab15ef
ATProto: assert that we only store record type objects in the repo 2023-10-03 16:56:06 -07:00
Ryan Barrett b70ef87236
hub: add dispatch.yaml for URL-based routing, update network ingress 2023-09-29 14:28:36 -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 247e8a465f
test_webfinger: tests for bad protocol subdomains 2023-09-29 12:33:55 -07:00
Ryan Barrett 318ba554d5
misc hub setup, testing live 2023-09-29 11:32:29 -07:00
Ryan Barrett f85ab9ef41
noop: add a couple minor tests and comments 2023-09-29 11:32:29 -07:00
Ryan Barrett 56c5909b84
add /bridge-user page to propagate a new user into ATProto
for #647
2023-09-29 11:32:28 -07:00
Ryan Barrett 4b94b4397c
User.get_or_create: fetch and propagate user profile object 2023-09-29 11:32:28 -07:00
Ryan Barrett bfabfabea7
move creating a new ATProto user from ATProto.send to User.get_or_create
in progress, still need to load user profile object and write it to ATProto repo
2023-09-29 11:32:28 -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 0b592ace35
update common.redirect_[un]wrap to handle all domains
including protocol subdomains
2023-09-27 13:10:28 -07:00
Ryan Barrett 59e9895ab4
activitypub actor and inbox: error on bad ids
eg status.php, looks like a domain but isn't

fixes https://console.cloud.google.com/errors/detail/CMyE7OD8zd6SnwE;time=P30D?project=bridgy-federated
2023-09-27 10:29:40 -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 8cd1bf809b
standardize AP endpoints mostly onto protocol subdomains
fixes #611
2023-09-26 20:04:57 -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 ef44dae317
ATProto: when storing user, always try to fetch DID doc if we don't have it 2023-09-26 14:47:26 -07:00
Ryan Barrett 068dcdeb86
ATProto.send: ignore accepts and undos 2023-09-26 14:47:26 -07:00
Ryan Barrett a9fcc167f6
replace User.readable_id computed property with handle 2023-09-25 15:08:14 -07:00
Ryan Barrett c27404d681
/web-site: gracefully handle blocklisted domains
fixes https://console.cloud.google.com/errors/detail/CJbG4sGlnK7Jdw;time=P30D;refresh=true?project=bridgy-federated
2023-09-25 14:45:04 -07:00
Ryan Barrett 9b8b02e99f
consolidate ap_address in ATProto, Fake, Web (partially) into User 2023-09-25 12:45:47 -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 6cdb04b53f
replace User.atproto_handle with handle_as('atproto') 2023-09-25 10:58:05 -07:00
Ryan Barrett 40ba007e9e
add User.handle() 2023-09-25 10:58:05 -07:00
Ryan Barrett 39752dc7ca
ids: allow same from and to protocol in convert_id, convert_handle 2023-09-25 10:58:05 -07:00
Ryan Barrett 2a7df37529
update atproto test_poll_notifications for fetching repo DID doc 2023-09-24 20:09:56 -07:00
Ryan Barrett 021df15f7e
Object.as1 from bsky: pass repo DID, handle, PDS to granary 2023-09-24 20:02:09 -07:00
Ryan Barrett 6a951138dc
oops, need to implement Web.profile_id after all
Web user ids are domains, eg user.com, but "web id" of a user profile is a full homepage url, eg https://user.com/
2023-09-23 14:57:26 -07:00
Ryan Barrett 325f8b3931
AP actor serving: resolve handles 2023-09-23 14:57:26 -07:00
Ryan Barrett 6ae57bfd94
atproto: bug fix for getRecord call 2023-09-23 13:52:49 -07:00
Ryan Barrett ff2be9e1ea
/r/ redirects: add bsky.app to domain allowlist 2023-09-23 13:50:19 -07:00
Ryan Barrett 452e49134d
add User.profile_id, implement in ATProto 2023-09-22 15:40:22 -07:00
Ryan Barrett e257d43f21
webfinger: if user part isn't an id, try resolving it as a handle 2023-09-22 15:14:15 -07:00
Ryan Barrett 6c87254efb
tests: make Fake handles use fake:handle: prefix 2023-09-22 14:53:56 -07:00
Ryan Barrett 169f8d7a2c
add Protocol.handle_to_id, implement in all protocols 2023-09-22 13:11:15 -07:00
Ryan Barrett e97270b344
add webfinger.fetch_actor_url, use it in follow
also add a basic test for webfinger.fetch
2023-09-22 12:48:00 -07:00
Ryan Barrett 0d33b6422d
add Protocol.owns_handle (and in subclasses) 2023-09-22 12:17:42 -07:00
Ryan Barrett 6a6a1657a7
rename Protocol.for_domain => for_bridgy_subdomain 2023-09-22 11:55:46 -07:00
Ryan Barrett 0d2ec18edd
add ids.convert_handle 2023-09-22 11:42:08 -07:00
Ryan Barrett e967bb4ada
start centralizing id conversion into new ids.py file 2023-09-22 11:42:08 -07:00
Ryan Barrett 5214c77f6a
Protocol.targets: find and add originals for targets that are copies
both Object and User originals
2023-09-19 21:52:28 -07:00
Ryan Barrett c1880569b8
User.get_by_copy => get_by_copies 2023-09-19 21:12:53 -07:00
Ryan Barrett 5107d003fe
Object.as1: genericize converting actor/author id from copy to original 2023-09-19 19:59:28 -07:00
Ryan Barrett 134416cd7b
genericize User.get_by_atproto_did to get_for_copy 2023-09-19 16:48:16 -07:00
Ryan Barrett bb18b5ee0d
add new User.copies property 2023-09-19 16:07:11 -07:00
Ryan Barrett f7792f81c8
tasks: add user param to receive, make create_task run inline in local server 2023-09-19 11:15:49 -07:00
Ryan Barrett cae19172c9
Protocol: add receive task handler 2023-09-18 19:19:59 -07:00
Ryan Barrett 7c35fe4b1b
atproto.poll_notifications: generate and send AppView JWT 2023-09-18 15:04:00 -07:00
Ryan Barrett dcbf16db6e
Object.as1 conversion from bsky, injecting actor/author
prefer user id to profile object id, default to AT URI repo DID
2023-09-18 11:52:17 -07:00
Ryan Barrett 5b16386fbc
User.get_by_atproto_did and Object.as1 from bsky: support native ATProto users 2023-09-18 11:41:01 -07:00
Ryan Barrett a723be660e
Object.as1: inject actor/author when converting from bsky objects
...since they imply actor/author in the AT URI's repo DID.
2023-09-18 11:23:11 -07:00
Ryan Barrett 48e47f5f7d
add User.get_by_atproto_did 2023-09-17 22:38:33 -07:00
Ryan Barrett b45635b125
noop: move canonicalizing AT URIs TODO from ATProto to Object 2023-09-14 16:52:22 -07:00
Ryan Barrett b8f55ec352
atproto test_poll_notifications: add like object
...now that granary does at least basic conversion of likes
2023-09-14 16:29:02 -07:00
Ryan Barrett 077b5a97bc
ATProto.send: populate Object.copies with local record's AT URI 2023-09-14 10:20:04 -07:00
Ryan Barrett d3b3ff47f5
atproto: start on polling notifications
lots more to do here, 8 new TODOs in this commit 😆
2023-09-14 09:42:11 -07:00
Ryan Barrett afda648a4a
tests: extract out assert_task() method 2023-09-13 14:36:24 -07:00
Ryan Barrett 61b585e715
for Objects for ATProto records, require at:// URIs to have DID repos
don't allow handles. https://atproto.com/specs/at-uri-scheme
2023-09-13 12:51:34 -07:00
Ryan Barrett 2bb5db826c
atproto: support bsky.app URLs as targets 2023-09-12 21:52:21 -07:00
Ryan Barrett bd09af9c24
atproto: use proper DID docs instead of PLC operations
corresponds to snarfed/arroba@d52cb4d. also fix verifying signature in PLC genesis operation.
2023-09-12 11:57:08 -07:00
Ryan Barrett a57edf8038
Web user signup: remove leading and trailing dots from domains 2023-09-10 22:04:00 -07:00
Ryan Barrett d2bb9108c7
atproto: switch to new simpler atproto-commit task without seq 2023-09-10 16:44:05 -07:00
Ryan Barrett fd6e371635
make Protocol._targets use per-protocol blocklist check 2023-09-09 15:11:52 -07:00
Ryan Barrett ee3b72fb1e
atproto: enqueue atproto-commit task for first commit on new repo 2023-09-09 07:50:53 -07:00
Ryan Barrett 165a403353
drop User.k256_pem, use arroba's AtpRepo.signing_key/rotation_key instead 2023-09-08 21:52:46 -07:00
Ryan Barrett ac06e0fef3
atproto: update for arroba rotation key, always create did:plc and repo together 2023-09-08 21:08:12 -07:00
Ryan Barrett 0bb1038c3a
updates for appengine_info changes, LOCAL => LOCAL_SERVER etc
snarfed/webutil@722053854a through snarfed/webutil@86d89bd3df
2023-09-07 12:01:43 -07:00
Ryan Barrett f116dbfa26
implement atproto_handle() in Web, ActivityPub, ATProto 2023-09-06 19:52:09 -07:00
Ryan Barrett f91486db75
add new atproto-commit task queue, enqueue tasks for new commits
hub will consume these and emit them to subscribeRepos subscribers
2023-09-05 20:10:11 -07:00
Ryan Barrett f03b97e44a
delete XRPC method handlers, they're unused 2023-09-04 08:12:17 -07:00
Ryan Barrett 70edf4173e
ATProto: when creating new repo, add user profile record if available 2023-09-01 14:18:50 -07:00
Ryan Barrett 7949dd0da7
ATProto: update target_for to handle non-ATProto users 2023-09-01 13:59:28 -07:00
Ryan Barrett abf583952c
first pass at ATProto.send 2023-09-01 12:07:21 -07:00
Ryan Barrett 3ff42f0cd4
User.p256_key = k256_key, for ATProto 2023-09-01 07:51:23 -07:00
Ryan Barrett 3cb1fea53f
ATProto: use handle in web_url() 2023-08-31 11:50:36 -07:00
Ryan Barrett fd4b40fe7c
implement default User.ap_actor() 2023-08-31 11:49:10 -07:00
Ryan Barrett 5c1032a7e7
implement ATProto.ap_address 2023-08-31 11:19:57 -07:00
Ryan Barrett 36be6b9dd2
implement ATProto.readable_id 2023-08-31 10:58:24 -07:00
Ryan Barrett e18dabf510
implement ATProto.target_for, .fetch for at:// URIs 2023-08-31 10:48:28 -07:00
Ryan Barrett 96b63487fa
implement ATProto.fetch for DIDs 2023-08-30 20:59:53 -07:00
Ryan Barrett 6ac1193171
implement ATProto.serve 2023-08-29 12:35:20 -07:00
Ryan Barrett f16011211e
update tests for granary atom change snarfed/granary@a82ecfd7d9 2023-08-29 11:39:48 -07:00
Ryan Barrett 4f7e394c6e
AP: add #key fragment to publicKey.id so it's not the same as actor id
thanks for the nudge @HelgeKrueger!
2023-08-26 09:21:53 -07:00
Ryan Barrett 9daa8f36eb
AP follow/unfollow UI: handle followees with composite url objects
ie with namedprofile links

fixes https://console.cloud.google.com/errors/detail/CKmLytj-nPv9RQ;time=P30D?project=bridgy-federated
2023-08-26 07:49:27 -07:00
Ryan Barrett 2742904468
ATProto: implement first pass at web_url 2023-08-23 21:04:17 -07:00
Ryan Barrett 16bbd66d91
ATProto: validate that key id is did:plc or did:web 2023-08-23 20:44:42 -07:00
Ryan Barrett 0c4f23dc18
start on ATProto!
for #381
2023-08-23 20:34:32 -07:00
Ryan Barrett 6cddd95686
AP: always populate inbox and outbox in actors
required by AP! https://www.w3.org/TR/activitypub/#actor-objects

for #614
2023-08-19 15:12:46 -07:00
Ryan Barrett 53518a3e4d
AP: handle Follow activities sent to shared inbox
fixes https://console.cloud.google.com/errors/detail/CKCyj4Cml--vUw;time=P30D?project=bridgy-federated
2023-08-09 11:26:36 -07:00
Ryan Barrett 9211aa3cae
bug fixes for Object.clear and get_or_create
be more careful about clearing and preserving as2/mf2/bsky/our_as1 properties

discovered by @jamietanna, thanks for reporting Jamie!
2023-08-08 10:26:00 -07:00
Ryan Barrett 62ba627bc9
bug fix for interactive follow with followee Object without as2
fixes https://console.cloud.google.com/errors/detail/CIeL-MyNk9z5LQ;time=P30D?project=bridgy-federated , https://console.cloud.google.com/errors/detail/COLs4IvxloWVUg;time=P30D?project=bridgy-federated
2023-08-01 09:47:32 -07:00
Ryan Barrett e389690276
Web.fetch: handle author missing u-url
originally from https://r0ss.me/notes/20230727-starfield-animated-videos.html
2023-07-28 19:13:59 -07:00
Ryan Barrett b2b5383271
fix authors in RSS and Atom feeds 2023-07-28 15:53:56 -07:00