Wykres commitów

66 Commity (f116dbfa265793ff647504f9a45e8570ced264ed)

Autor SHA1 Wiadomość Data
Ryan Barrett f116dbfa26
implement atproto_handle() in Web, ActivityPub, ATProto 2023-09-06 19:52:09 -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 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 2f308b43e2
/convert: use generic Protocol for fed subdomain
not entirely sure about this one, will see

for #600
2023-07-26 09:02:23 -07:00
Ryan Barrett 96e523d887
fix Object.proxy_url to use per-protocol subdomains
it should have already been using them!

for #600
2023-07-26 09:02:23 -07:00
Ryan Barrett aa124413f6
Web: set author to user homepage more carefully
for when h-entry author points to non-homepage, eg @techlifeweb's https://techlifeweb.com/blog/2023/07/2023-07-25-post-025/ 's author url is https://techlifeweb.com/hcard
2023-07-24 21:28:37 -07:00
Ryan Barrett 850e8a1dc8
switch convert URLs from ^^ back to #
for #581. the ^^s didn't help with WordPress, which was the original motivation, and they're confusing everyone else.
2023-07-24 14:31:07 -07:00
Ryan Barrett 414fa5f197
Protocol.receive: resume existing create if it's not complete 2023-07-24 14:07:44 -07:00
Ryan Barrett 95cbfba31c
Web: default missing author to homepage, not fed.brid.gy AP actor URL
for #599
2023-07-24 12:17:03 -07:00
Ryan Barrett 17fe6db6eb
change Protocol.key_for to return None instead of raise on invalid user ids
hopefully fixes https://console.cloud.google.com/errors/detail/CKWmwa7SybLcQw;time=P30D?project=bridgy-federated
2023-07-22 20:32:55 -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 ad893b1a97
update test_activitypub, test_web for new Object.notify/feed props
added in 95d0a695aa30c06880c218a96a98f591850a0a3c
2023-07-17 05:34:56 -10:00
Ryan Barrett 4b66e68232
Web.send: improve logic for skipping sends to followers
should stop the unrelated webmentions going to @gRegorLove et al
2023-07-15 14:33:54 -07:00
Ryan Barrett 8903273c2a
merging receive: Web: skip sending wms for normal posts (ie not replies etc)
for #529
2023-07-14 17:22:59 -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 0e47918a38
merging receive: skip same-protocol deliveries and Followers
for #529
2023-07-13 14:21:13 -07:00
Ryan Barrett 815ae95560
merging receive: bug fix for same domain check: normalize target URLs earlier
for #529, a3f99a81ce
2023-07-11 13:25:32 -07:00
Ryan Barrett 15557dc78f
merging receive: Web: handle ValueError raised by protocol.receive
for #529
2023-07-11 13:25:31 -07:00
Ryan Barrett 0d7df6d4e6
merging receive: handle follow with multiple objects (followees)
for #529
2023-07-11 13:25:31 -07:00
Ryan Barrett cfa43135a5
Web.fetch default author bug fix, only add if URL is not homepage 2023-07-11 13:25:31 -07:00
Ryan Barrett a2ed0afda8
merging receive: Web.fetch: default actor/author to home page URL
for #529
2023-07-11 13:25:31 -07:00
Ryan Barrett ceb72e516c
Web.send: ignore accept activities
webmention/mf2 have no corrolary yet
2023-07-11 13:25:31 -07:00
Ryan Barrett 911dc56367
merging receive: check for already seen activity ids more carefully
for #529
2023-07-11 13:25:30 -07:00
Ryan Barrett 2c861dbbf4
merging receive: if incoming object has no id (eg web/mf2), default to URL
for #529
2023-07-11 13:25:30 -07:00
Ryan Barrett 56ebdba049
merging receive: propagate new/changed from receive into new Object
for #529
2023-07-11 13:25:30 -07:00
Ryan Barrett 5f4d6757e7
merging Protocol/Web receive: minor fix for extracting activity id
for #529
2023-07-11 13:25:30 -07:00
Ryan Barrett 568681a19e
merging Protocol/Web receive: start to work through test_web
for #529
2023-07-11 13:25:30 -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 1d58518edf
add test for post with multiple types
for https://console.cloud.google.com/errors/detail/CNCkorXE2bzlVg;time=P30D?project=bridgy-federated , fixed by snarfed/granary@2c5107d0bf
2023-07-06 07:38:25 -07:00
Ryan Barrett cae406e6c4
don't allow BF domains in ActivityPub or Web ids
also other ActivityPub id validation. #558
2023-06-23 12:22:37 -07:00
Ryan Barrett 65b4f1495f
Protocol.receive: fail "intra-BF" activities from ourselves
for #558
2023-06-23 11:20:29 -07:00
Ryan Barrett 8748e9a691
update tests to match new profile link HTML values
corresponds to snarfed/granary@f608f3e63b
2023-06-22 22:32:50 -07:00
Ryan Barrett d73206c7c5
*.target_for() bug fix: don't assert that source_protocol matches
ugh. ideally we should keep these, but we have existing entities in prod that don't match, eg ActivityPub https://indieweb.social/users/bismark has source_protocol webmention.

fixes https://console.cloud.google.com/errors/detail/CMT-oN6iy7DMwwE;time=P30D?project=bridgy-federated
2023-06-21 07:38:36 -07:00
Ryan Barrett 9467f38180
generalize wm => AP delivery logic across protocols!
phew! another tough one. #529
2023-06-20 20:59:32 -07:00
Ryan Barrett ab1c28ee4d
noop, lint fixes from flake8
remaining:

$ flake8 --extend-ignore=E501 *.py tests/*.py
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'"
Run flake8 with greater verbosity to see more details
activitypub.py:15:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
activitypub.py:36:1: F401 'web' imported but unused
activitypub.py:48:1: E302 expected 2 blank lines, found 1
activitypub.py:51:9: F811 redefinition of unused 'web' from line 36
app.py:6:1: F401 'flask_app.app' imported but unused
app.py:9:1: F401 'activitypub' imported but unused
app.py:9:1: F401 'convert' imported but unused
app.py:9:1: F401 'follow' imported but unused
app.py:9:1: F401 'pages' imported but unused
app.py:9:1: F401 'redirect' imported but unused
app.py:9:1: F401 'superfeedr' imported but unused
app.py:9:1: F401 'ui' imported but unused
app.py:9:1: F401 'webfinger' imported but unused
app.py:9:1: F401 'web' imported but unused
app.py:9:1: F401 'xrpc_actor' imported but unused
app.py:9:1: F401 'xrpc_feed' imported but unused
app.py:9:1: F401 'xrpc_graph' imported but unused
app.py:9:19: E401 multiple imports on one line
models.py:19:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
models.py:364:31: E114 indentation is not a multiple of four (comment)
models.py:364:31: E116 unexpected indentation (comment)
protocol.py:17:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
redirect.py:26:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
web.py:18:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
webfinger.py:13:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
webfinger.py:110:13: E122 continuation line missing indentation or outdented
webfinger.py:111:13: E122 continuation line missing indentation or outdented
webfinger.py:131:13: E122 continuation line missing indentation or outdented
webfinger.py:132:13: E122 continuation line missing indentation or outdented
webfinger.py:133:13: E122 continuation line missing indentation or outdented
webfinger.py:134:13: E122 continuation line missing indentation or outdented
tests/__init__.py:2:1: F401 'oauth_dropins.webutil.tests' imported but unused
tests/test_follow.py:11:1: F401 'oauth_dropins.webutil.util.json_dumps' imported but unused
tests/test_follow.py:14:1: F401 '.testutil.Fake' imported but unused
tests/test_models.py:156:15: E122 continuation line missing indentation or outdented
tests/test_models.py:157:15: E122 continuation line missing indentation or outdented
tests/test_models.py:158:11: E122 continuation line missing indentation or outdented
tests/test_web.py:12:1: F401 'oauth_dropins.webutil.util.json_dumps' imported but unused
tests/test_web.py:17:1: F401 '.testutil' imported but unused
tests/test_web.py:1513:13: E128 continuation line under-indented for visual indent
tests/test_web.py:1514:9: E124 closing bracket does not match visual indentation
tests/testutil.py:106:1: E402 module level import not at top of file
tests/testutil.py:107:1: E402 module level import not at top of file
tests/testutil.py:108:1: E402 module level import not at top of file
tests/testutil.py:109:1: E402 module level import not at top of file
tests/testutil.py:110:1: E402 module level import not at top of file
tests/testutil.py:301:24: E203 whitespace before ':'
tests/testutil.py:301:25: E701 multiple statements on one line (colon)
tests/testutil.py:301:25: E231 missing whitespace after ':'
2023-06-20 11:29:31 -07:00
Ryan Barrett 374354a21f
add Protocol.target_for()
for #529
2023-06-16 13:16:17 -07:00
Ryan Barrett d3c4415cd3
migrate User.actor_as2 to obj key pointing to Object
for #547
2023-06-15 21:23:31 -07:00
Ryan Barrett bbcb8de44a
noop test refactoring: finally unify request context push/pop into testutil 2023-06-15 15:09:03 -07:00
Ryan Barrett 60a4a2bb9f
move domain non-TLD validation from webfinger into Web
fixes https://console.cloud.google.com/errors/detail/CMG7h4PJju67Og;time=P30D?project=bridgy-federated
2023-06-15 11:25:31 -07:00
Ryan Barrett ed734f3532
Protocol.receive: finish full protocol inference based on target ids
for #548, #512
2023-06-14 13:46:13 -07:00
Ryan Barrett 974fa71443
Web.username: handle bad acct: URIs
fixes https://console.cloud.google.com/errors/detail/CPLmrpzFs4qTUA;time=P30D?project=bridgy-federated
2023-06-14 13:34:29 -07:00
Ryan Barrett e6f72f33b6
Web.load: default check_backlink kwarg to False, pass it through to fetch 2023-06-13 20:24:42 -07:00
Ryan Barrett 7b3aeb2e8e
add Protocol.key_for to let us normalize Web keys from http://x.com/ => x.com
for #548, #512
2023-06-13 14:30:00 -07:00
Ryan Barrett 48c40c10a8
add Protocol.for_id and .owns_id
fixes #548
2023-06-13 13:21:30 -07:00
Ryan Barrett 9ee616b4c2
update profile bug fix, update local user as well as sending fediverse Update
thanks for reporting @KR4DIO!
2023-06-10 07:16:54 -07:00
Ryan Barrett c98ab3f2d5
AP users: Object schema change, domains => users
also for AP => wm, only try to send webmentions to domains that we already have an existing Web user for. the vast majority of targets are fediverse URLs, and we were trying to send them all wms, ie at least running wm discovery and finding nothing. harmless, but a waste.
2023-06-09 12:56:45 -07:00
Ryan Barrett 7f6cc61683
improve domain validation for Web key ids, normalize to lower case 2023-06-09 10:58:28 -07:00
Ryan Barrett 861552f455
webfinger verification: handle URL-encoded Location header
fixes #535
2023-06-08 11:07:24 -07:00
Ryan Barrett 7c82bf7ec5
AP users: finish migrating Follower from string domains/ids to User keys
for #512
2023-06-07 19:06:44 -07:00
Ryan Barrett 9cb8c1f9f2
AP users: start migrating Follower from string domains/ids to User keys
for #512
2023-06-07 12:43:48 -07:00