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
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
a9fcc167f6
replace User.readable_id computed property with handle
2023-09-25 15:08:14 -07:00
Ryan Barrett
1a003c8c5b
refactor User.ap_address implementations to highlight similarities
2023-09-25 14:16:14 -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
d8f2bbbeed
special-case Web in a few places in postprocess_as2 and actor handler
2023-09-24 20:06:18 -07:00
Ryan Barrett
325f8b3931
AP actor serving: resolve handles
2023-09-23 14:57:26 -07:00
Ryan Barrett
169f8d7a2c
add Protocol.handle_to_id, implement in all protocols
2023-09-22 13:11:15 -07:00
Ryan Barrett
0d33b6422d
add Protocol.owns_handle (and in subclasses)
2023-09-22 12:17:42 -07:00
Ryan Barrett
0d2e4fb66a
noop: protocol: label classmethod cls identifiers with from/to
2023-09-09 14:19:27 -07:00
Ryan Barrett
f116dbfa26
implement atproto_handle() in Web, ActivityPub, ATProto
2023-09-06 19:52:09 -07:00
Ryan Barrett
8b242e65ba
move common.is_blacklisted to Protocol so that subclasses can override it
2023-09-06 17:35:15 -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
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
8850e27374
Activity.target_for: fix infinite loop when author is object id
...
fixes #603 and https://console.cloud.google.com/errors/detail/CLPmoOqegtfm0AE;time=P30D?project=bridgy-federated
2023-07-27 15:06:56 -07:00
Ryan Barrett
77812b1b61
AP: fix sig verification bug, handle Objects with non-as2 data
...
fixes https://console.cloud.google.com/errors/detail/CKCN17fmoZHraw;time=P30D?project=bridgy-federated
2023-07-24 18:16:50 -07:00
Ryan Barrett
9a7597b365
don't allow blocklisted domains in Web, ActivityPub ids
...
for #597
2023-07-22 20:09:16 -10:00
Ryan Barrett
405ca4145f
Web.send, ActivityPub.send: skip sending to blocklisted URLs
...
for #597
2023-07-22 20:02:12 -10:00
Ryan Barrett
80d1ec745e
ActivityPub.signed_request: handle redirects to relative URLs
...
fixes https://console.cloud.google.com/errors/detail/COLi8YPesYOztwE;time=P30D?project=bridgy-federated
2023-07-14 18:16:10 -07:00
Ryan Barrett
e194ccb3ad
Protocol.load/fetch returns True/False (or None) to mean "not this protocol"
...
ie, nothing failed, but the given id eitehr doesn't below to the given protocol, or fetched successfully but its data belongs to a different protocol.
vs raising exceptions for fetches that fail or error, eg network connection problems, Web got HTML with microformats2 but no h-entry, ActivityPub got non-AS2, etc.
used in Protocol.for_id: when a given Protocol's fetch doesn't work, we move on and try the next protocol _if_ it returned False (ie wasn't fetchable with that protocol, but we fail fast if it raises an exception (ie fetch failed).
2023-07-14 12:58:47 -07:00
Ryan Barrett
dcc9b772b1
ActivityPub.send: handle unset g.user, missing actor
2023-07-14 12:58:46 -07:00
Ryan Barrett
b3a3de73f2
extend Web/ActivityPub.owns_id() to return False if blocklisted
2023-07-11 13:25:29 -07:00
Ryan Barrett
ee3a596dbb
Summary merging Protocol/Web receive: change receive to take Object
...
for #529
2023-07-11 13:25:29 -07:00
Ryan Barrett
d0d6a13044
merging Protocol/Web receive: tweaks to Object.users, Object.labels
...
for #529
2023-07-11 13:25:28 -07:00