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
22b80e4eaf
bug fix for e5abdc0: set g.user before activitypub.postprocess_as2
...
for #383
2023-11-23 07:57:39 -08:00
Ryan Barrett
e5abdc097f
implement outbox
...
only first page. for #383
2023-11-22 21:40:36 -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
eb7da31873
minimize g.user in activitypub.actor
...
for #690
2023-11-19 21:53:39 -08:00
Ryan Barrett
8b3881dfe3
stop using g.user in pages, activitypub followers/ing collections
...
for #690
2023-11-19 21:53:38 -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
4c61770017
activitypub: drop circular import of web
...
for #486
2023-11-15 13:33:39 -08:00
Ryan Barrett
59c6d44f6d
AP: stop using PROTOCOLS in inbox URL routes
...
for #486
2023-11-15 13:33:39 -08:00
Ryan Barrett
2d4e4afbaa
stop logging headers during sig verification
2023-11-13 21:01:38 -08:00
Ryan Barrett
6498c24d98
AP sig verification bug fix: support lower case sha-256= Digest prefix
...
found with https://verify.funfedi.dev/?actor_uri=https%3A%2F%2Ffed.brid.gy%2Fsnarfed.org . thanks @HelgeKrueger!
2023-11-12 07:48:48 -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
ae2cb2825b
activitypub.postprocess_as2: use real AP actor id in key id
2023-11-08 11:28:17 -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
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
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
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
e214e4986b
activitypub.postprocess_as2: remove redundant wrap for Deletes
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
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
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
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
6f1bf8a5ef
activitypub: handle query params in URL when checking HTTP Sig
2023-10-19 22:15:39 -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
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
e66ca3fb7f
noop: expand a few log messages
2023-10-18 13:13:44 -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
441c5aa29f
log_data bug fixes
2023-10-14 14:13:13 -07:00
Ryan Barrett
f3039fc87a
Protocol.send: bring back log_data kwarg
2023-10-13 18:29:28 -07:00
Ryan Barrett
3046d2b28c
drop 1k followers limit in UI
...
fixes #670 , at least for now. counting 1200 followers in prod was taking ~200ms; not great, but not horrible. should cache this eventually though!
2023-10-13 09:46:36 -07:00
Ryan Barrett
9808bed1b4
ActivityPub.postprocess_as2: add Mention tags to cc
2023-10-12 16:22:57 -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
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
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
62302b9105
more docstring formatting tweaks
2023-10-06 08:22:50 -07:00
Ryan Barrett
db29ad7757
docs: fix docstring formatting, other tweaks
2023-10-05 23:32:31 -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
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
8cd1bf809b
standardize AP endpoints mostly onto protocol subdomains
...
fixes #611
2023-09-26 20:04:57 -07:00