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
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