Ryan Barrett
bf657d3409
ActivityPub.inbox: return 400 on invalid activity id
...
fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P7D?project=bridgy-federated
2024-06-20 14:32:37 -07:00
Ryan Barrett
32c69876fb
AP: bug fix for converting Link attachments to HTML links in content
...
for 980a786
, #958
2024-06-19 13:54:06 -07:00
Ryan Barrett
980a786c6b
AP: convert Link attachments to HTML links in content
...
...since some fediverse platforms (notably Mastodon) will render them as blank "Preview not available" embeds, and support on other platforms is unreliable. Most reliably generate preview embeds for HTML links in content though.
fixes #958
2024-06-19 13:29:20 -07:00
Ryan Barrett
49445c9f97
AP outbox and following endpoints: 404 if user hasn't enabled AP
2024-06-14 12:00:20 -07:00
Ryan Barrett
f21bc2cfe8
ActivityPub.target_for: pass shared kwarg through to recursive call
2024-06-13 20:11:37 -07:00
Ryan Barrett
4e489a4ee0
activitypub.inbox: store seen activity ids in memcache, short circuit on seen ids earlier
2024-06-13 13:54:37 -07:00
Ryan Barrett
441849a22a
Revert "Revert "start using an ndb in memory global cache in the frontends and router""
...
This reverts commit 0cbcf81ecc
.
trying again!
2024-06-04 14:27:02 -07:00
Ryan Barrett
83893d0ea7
HTTP caching headers: switch to flask_util.headers
...
for #432 , fixes https://console.cloud.google.com/errors/detail/CMK10__x4ZbgbQ;time=P7D;refresh=true?project=bridgy-federated
2024-06-04 14:19:39 -07:00
Ryan Barrett
cc564a2b19
turn on authorization checks! HTTP sig matches actor, actor is allowed to modify object
...
for #566
2024-06-03 14:12:08 -07:00
Ryan Barrett
5266974731
Protocol.for_id: make Web own bot actor AP ids, not bot protocol
2024-06-02 08:21:18 -07:00
Ryan Barrett
a2376f8f14
prune more logging messages
2024-06-01 07:17:44 -07:00
Ryan Barrett
0cbcf81ecc
Revert "start using an ndb in memory global cache in the frontends and router"
...
This reverts commit 7e77d7a463
.
This slows down receive task processing, tasks all start taking longer and longer, can't figure out why. some kind of lock starvation in the global cache?
will experiment with this more in the ndb-global-cache branch.
2024-06-01 07:04:38 -07:00
Ryan Barrett
7e77d7a463
start using an ndb in memory global cache in the frontends and router
...
lol yolo 982f8a70df/google/cloud/ndb/global_cache.py (L200-L202)
> Not intended for production use. Uses a single process wide dictionary to
> keep an in memory cache. For use in testing and to have an easily grokkable
> reference implementation. Thread safety is potentially a little sketchy.
2024-05-31 13:08:25 -07:00
Ryan Barrett
d0ca690dc4
HTTP Cache-Control header bug fix, use integer seconds for max-age, not float
...
for #432
2024-05-30 17:12:45 -07:00
Ryan Barrett
9c4888b02e
switch from flask_util.cached to HTTP caching, suppress some verbose logging
2024-05-30 14:55:35 -07:00
Ryan Barrett
7e594e3227
authz: move NO_AUTH_DOMAINS (a.gup.pe) from Protocol.receive to activitypub.inbox
...
for #566
2024-05-30 13:34:14 -07:00
Ryan Barrett
fda7a79437
authz: on delete of actor signed by actor, pass authed_as to Object.get_or_create
...
for #566
2024-05-30 11:39:07 -07:00
Ryan Barrett
9f33767f33
authz: move LD Sig check from Protocol.receive to activitypub.inbox
...
for #566
2024-05-29 21:17:38 -07:00
Ryan Barrett
8f5d8221a9
add ids.profile_id, use everywhere
...
for #566
2024-05-29 16:18:15 -07:00
Ryan Barrett
f2a64c8b5c
Object.get_or_create: rename actor => authed_as, add to all calls
...
for #566
2024-05-28 16:07:32 -07:00
Ryan Barrett
916421c033
activitypub authz logging, preserve original keyId, including fragment
...
for #566
2024-05-28 16:00:21 -07:00
Ryan Barrett
22760f5017
ActivityPub.verify_signature: follow controller/owner if different from keyId
...
for https://github.com/snarfed/bridgy-fed/issues/566#issuecomment-2130728082
https://swicg.github.io/activitypub-http-signature/#how-to-obtain-a-signature-s-public-key
2024-05-28 13:48:03 -07:00
Ryan Barrett
3ec5e57136
activitypub.signed_request: limit redirects
...
for #1085 , #1087
2024-05-27 21:02:59 -07:00
Ryan Barrett
03672679b9
activitypub, protocol: misc noop logging and code style tweaks
2024-05-27 20:38:49 -07:00
Ryan Barrett
d789fd10b6
ActivityPub.inbox: run receive in task instead of inline
...
for #1040
2024-05-23 15:02:49 -07:00
Ryan Barrett
769dadb882
ATProto: arroba: send_new_commits => send_events
...
snarfed/arroba@aad0d9da63
2024-05-22 16:47:09 -07:00
Ryan Barrett
b4124bd23f
AP: wrap content in <p> tag to preserve whitespace
...
for #990
this assumes an implementation detail of fediverse servers: that they apply a white-space: pre-wrap style to <p>s inside content. awkward overreach, but useful since white-space: pre-wrap preserves more whitespace (eg leading spaces on a line, multiple spaces, etc) than just converting newlines to <br>s.
2024-05-20 12:18:41 -07:00
Ryan Barrett
edf3b5894e
activitypub.postprocess_as2: linkify indexed tags in content
...
makes Mastodon etc link them correctly to the local instance's UI in its rendering
2024-05-19 20:38:34 -07:00
Ryan Barrett
9243e18a4f
activitypub.postprocess_as2: hashtags: use activity id's domain for href
...
for https://github.com/snarfed/bridgy-fed/issues/1013
2024-05-19 17:56:26 -07:00
Ryan Barrett
ec350e7fa6
activitypub.postprocess_as2: fix de-duping image attachments
...
for https://github.com/snarfed/bridgy-fed/issues/1000#issuecomment-2119106644
2024-05-19 15:38:13 -07:00
Ryan Barrett
7cf8a77a73
ActivityPub.postprocess_as2: always populate images into attachments as objects
...
hopefully for https://github.com/snarfed/bridgy-fed/issues/1000#issuecomment-2119106644 , ATProto images without alt text not showing up in AP
2024-05-19 14:44:54 -07:00
Ryan Barrett
f6798f2725
abstract "bridged from Bridgy Fed" profile label across protocols
...
for #976
2024-05-14 16:03:42 -07:00
Ryan Barrett
b7a55d2f5e
ActivityPub.signed_request: pass from_user through on redirects
...
re https://akkoma.dev/AkkomaGang/akkoma/issues/438#issuecomment-12042 . thanks https://akkoma.dev/Oneric !
2024-05-14 10:42:11 -07:00
Ryan Barrett
348987f0b4
add Protocol.REQUIRES_OLD_ACCOUNT, enable for ActivityPub
2024-05-11 19:20:33 -07:00
Ryan Barrett
078bef041e
turn on REQUIRES_AVATAR/NAME for ActivityPub, Bluesky
2024-05-11 16:50:57 -07:00
Ryan Barrett
de0af66979
basic anti-spam: add new Protocol.REQUIRES_AVATAR/NAME constants
...
...and start returning `blocked` from User.status for them
2024-05-11 16:03:07 -07:00
Ryan Barrett
034236f4cf
AP: don't duplicate security context in @context in bot users
...
fixes #1003 . thanks @grishka!
2024-05-05 08:29:47 -07:00
Ryan Barrett
0781a4c695
AP inbox delivery: return 422 when a user with a bad handle follows the bot user
...
for #982
2024-05-04 13:39:39 -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
073ce475e5
Protocol.receive: bridge replies to followers where in-reply-to already is
...
...ie if it's on the follower's protocol, either native or bridged.
for #981 , #950 , #949
not confident in this, despite the tests. worried it will either over- or under-deliver. guess we'll see.
2024-05-01 17:45:48 -07:00
Ryan Barrett
c8ca31554b
AP: strip Link attachments since fedi instances generate their own link previews
...
hopefully fixes #958
2024-04-29 15:13:12 -07:00
Ryan Barrett
cbe4b59206
convert Protocol.is_enabled_to to an instance method
...
next commit will move it to User
2024-04-27 20:27:33 -07:00
Ryan Barrett
0b00e6eb4b
AP: serve protocol bot users on their own subdomains
2024-04-22 16:07:54 -07:00
Ryan Barrett
10023d17fd
Protocol.enable_protocol: create copy user if necessary
2024-04-21 12:18:12 -07:00
Ryan Barrett
f357ea1698
ActivityPub: accept non-public DMs to protocol bot users
...
for #880
2024-04-21 08:36:03 -07:00
Ryan Barrett
1686a2ba91
opt in/out prompt: accept yes/no DMs to bot users to enable/disable protocols
...
for #880
2024-04-21 08:08:12 -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
f840c8b784
temporarily disable is_enabled checks in ATProto/ActivityPub.convert
...
for manual testing
2024-04-14 14:50:02 -07:00
Ryan Barrett
133d640f1d
improve rendering of ATProto interactions on user pages
...
for #825
2024-04-11 15:02:15 -07:00
Ryan Barrett
bf296802d8
pass from_user through to convert() in a few more places
2024-04-10 15:16:37 -07:00