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
Ryan Barrett
44fee79838
incoming AP: allow missing HTTP Sig when DEBUG is on
2023-06-27 22:35:42 -07:00
Ryan Barrett
9140318f4a
generalize Protocol.accept_follow, other bug fixes in Protocol.receive
...
for #529 , fixes https://console.cloud.google.com/errors/detail/CMbJ6a6j56LErwE;time=P30D?project=bridgy-federated
2023-06-26 20:22:55 -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
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
2a7425a8c6
formalize Protocol.target_for() to take any object, not just actors
...
important because webmention endpoints are per page (object), not per site (actor).
2023-06-20 17:06: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
8b9d0147db
postprocess_as2() bug fix for Accepts
2023-06-16 14:27:46 -07:00
Ryan Barrett
1821e90f36
add Object.as_as2()
2023-06-16 14:09:28 -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
e6f72f33b6
Web.load: default check_backlink kwarg to False, pass it through to fetch
2023-06-13 20:24:42 -07:00
Ryan Barrett
48c40c10a8
add Protocol.for_id and .owns_id
...
fixes #548
2023-06-13 13:21:30 -07:00
Ryan Barrett
3448ec7368
AP users: generalize receiving class in Protocol.receive
...
for #512
2023-06-12 19:01:50 -07:00
Ryan Barrett
cb1f80832f
AP users: add Protocol.ABBREV, Protocol.OTHER_LABELS
...
for #512
2023-06-11 08:14:17 -07:00
Ryan Barrett
510cd036bf
AP users: add Protocol.for_domain and for_request
...
getting ready to serve per-protocol subdomains, eg nostr.brid.gy, ap.brid.gy, etc
for #512
2023-06-10 19:55:08 -07:00
Ryan Barrett
6796b47a9f
noop: move web.NoMicroformats to common, misc other minor cleanup
2023-06-10 07:53:07 -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
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
Ryan Barrett
51c2773594
AP users: /r/: switch external user to indirect user
...
for #512
2023-06-04 20:58:21 -07:00
Ryan Barrett
47b3dd29d0
AP users: minor tweak, include full @context in indirect users' actors
...
for #512
2023-06-04 07:33:30 -07:00
Ryan Barrett
fe27742b80
AP users: promote ActivityPub.label_id computed prop to User.readable_id
...
and drop ActivityPub.get_by_id() override, move logic to user() page handler. fixes 'Only ancestor queries are allowed inside transactions.'
for #512
2023-06-03 21:48:15 -07:00
Ryan Barrett
cf68c1ebc7
AP users: fill in more fields in base actor objects
...
working on Mastodon account discovery interop. for #512
2023-06-03 08:36:55 -07:00
Ryan Barrett
c41b55a199
Web.fetch: switch back to raising instead of returning empty Object
...
raise new custom NoMicroformats exception
2023-06-03 07:28:01 -07:00
Ryan Barrett
d9cd5d14b9
AP users: fetch user on demand on /[actor] if we don't already have it
...
also change Web.fetch() to allow missing mf2 instead of raising exception. we now create Web users with None for mf2 property if the site has no mf2.
for #512
2023-06-02 12:55:07 -07:00
Ryan Barrett
e05ddb0a45
AP users: serve ActivityPub user page with address (handle) in URL
...
eg /activitypub/@me@instance.com
for #512
2023-06-01 22:00:47 -07:00
Ryan Barrett
ca64793fff
AP users: add User.name() and label_id(), ActivityPub.address computed property
...
for #512
2023-06-01 21:37:58 -07:00
Ryan Barrett
17ed24b6f5
AP users: switch ActivityPub.ap_address() to use as2.address()
...
for #512
2023-06-01 20:58:42 -07:00
Ryan Barrett
958f81ddd1
AP users: rename [is_]homepage => [is_]web_url, move into Protocol subclasses
...
for #512
2023-05-31 18:47:40 -07:00
Ryan Barrett
28eabd07a3
create AP users on inbox delivery for an indirect or nonexistent Web user
...
for #512
2023-05-31 13:17:17 -07:00
Ryan Barrett
35060c172a
switch actor_id() and address90 back to User methods, to be implemented by subclasses
...
partially reverts 9e906f18e4
2023-05-31 10:10:14 -07:00
Ryan Barrett
9e906f18e4
move address, actor_id from User to activitypub.py, /web-site to web.py
...
for #512
2023-05-30 17:24:49 -07:00
Ryan Barrett
29f1a1d4ac
AP users: start parameterizing URLs, including UI pages and AP endpoints
...
user pages now have /[protocol]/ prefix, AP endpoints have /ap/ prefix. for #512
2023-05-30 16:38:58 -07:00
Ryan Barrett
72024f90b1
bug fix for application/ld+json content type
...
fixes #522
2023-05-28 08:06:36 -07:00
Ryan Barrett
c8b2103e13
rename Webmention class => Web, webmention.py => web.py
2023-05-26 17:40:29 -07:00
Ryan Barrett
eaa4e5333a
start to make User subclasses for each protocol
...
#512
2023-05-26 16:07:36 -07:00
Ryan Barrett
cf86f4d808
AP users: extract out Protocol.serve() method
...
#512
2023-05-23 21:30:57 -07:00
Ryan Barrett
f933c7e237
AP users: serve AS2 for external homepage URLs
...
#512
2023-05-22 23:17:42 -07:00
Ryan Barrett
5aba64004f
wm => AP: inline most objects as bare string ids, not composite objects
...
for interop
2023-04-19 16:21:21 -07:00
Ryan Barrett
d9b1223392
wm => AP: fix reposts from h-cites that turn into composite objects
...
instead of bare string id objects. thanks @gRegorLove for reporting!
2023-04-19 14:37:42 -07:00
Ryan Barrett
d2ab48b23e
switch circular imports to runtime imports; split out flask_app.py from app.py
...
runtime imports are just as bad, but...meh. eventually I'll untangle them for real. #486
2023-04-18 17:18:17 -07:00
Ryan Barrett
212f2b11ec
wm => AP: add delete support
...
fixes #30
2023-04-17 15:36:29 -07:00
Ryan Barrett
ba38d6853b
bug fixes for hs2019 HTTP Signatures algorithm, hard coding to rsa-sha256
2023-04-17 11:15:05 -07:00
Ryan Barrett
842f8ac964
temporary: assume HTTP Signature algorithm=hs2019 means rsa-sha256
...
still trying to figure this out. see https://github.com/snarfed/bridgy-fed/issues/430#issuecomment-1510462267 , https://arewehs2019yet.vpzom.click/ , etc.
2023-04-16 16:35:31 -07:00
Ryan Barrett
629c1a2bd4
unify Object.new/changed generation into Protocol.load
...
also:
* switch back to preserving fragments in URL ids
* webmention.fetch: if URL id redirects, preserve original id in Object
2023-04-03 07:53:15 -07:00
Ryan Barrett
f836762b0f
big webmention.py refactoring
...
* use Objects properly
* use Object's mf2/AS2/AS1 conversion
* drop resuming partially completed deliveries
* use load, fetch, send
* get closer to unifying all activity handling into Protocol.receive
2023-04-01 19:13:51 -07:00
Ryan Barrett
e41ce9216c
noop, rename Protocol.get_object => Protocol.load
2023-03-29 13:13:32 -07:00
Ryan Barrett
e6be9cabb8
incoming AP: when we can't load the keyId, store a deleted Object
...
prevents re-fetching the same failing keyId actor over and over when we get the same Delete actor activity sent to all of our inboxes
2023-03-29 12:51:37 -07:00
Ryan Barrett
754a6eb651
minor noop tweaks: dupe test, test name, docstring
2023-03-27 14:18:24 -07:00
Ryan Barrett
28e8baff6c
change Protocol.fetch() to return an Object instead of populating one
2023-03-22 20:49:28 -07:00
Ryan Barrett
88dd51b05b
continue abstracting logic in Protocol class
...
lots more to do.
also convert Object.as1 to AS2 in ActivityPub.send if necessary.
2023-03-20 19:17:55 -07:00
Ryan Barrett
fb5f7b3fb0
move current user into Flask g request-global
2023-03-20 14:28:14 -07:00
Ryan Barrett
b2c60226b7
add Webmention.send, tweak method signature
2023-03-20 11:26:43 -07:00
Ryan Barrett
d433dd3abe
wm => AP: switch actors in outgoing activities from objects to string ids
...
mostly. also inlines single-element attributedTo lists to just the element, without the list.
2023-03-19 09:34:42 -07:00
Ryan Barrett
5169c2e44e
misc noop tweaks, mostly tests
2023-03-19 09:34:42 -07:00
Ryan Barrett
5e3c623552
add User.actor_id()
2023-03-19 09:34:42 -07:00
Ryan Barrett
be54842ce6
docs for hashtags
...
#45
2023-03-14 15:36:18 -07:00
Ryan Barrett
ce37dd8637
process hashtags in tab objects with Mastodon-specific logic
...
lots of background in #45 . also https://docs.joinmastodon.org/spec/activitypub/#properties-used
2023-03-14 14:59:28 -07:00
Ryan Barrett
01768fd58e
move accept_follow from activitypub to protocol
2023-03-11 13:01:23 -08:00
Ryan Barrett
bd748f5db1
bug fix for deb4b12659
...
fixes https://console.cloud.google.com/errors/detail/CNrPlPDIlZ-CUA;time=P30D?project=bridgy-federated
2023-03-10 07:49:41 -08:00
Ryan Barrett
abf7a9adfe
activitypub.py: minor noop tweaks, add log message
2023-03-10 07:36:50 -08:00
Ryan Barrett
deb4b12659
AS2: short circuit out on Delete actor that we don't have stored
...
...since when we try to fetch the actor to get their key to verify the signature, we get an HTTP 410 response, at least from Mastodon.
2023-03-10 07:36:50 -08:00
Ryan Barrett
31645618dc
abstracting protocols: start to use send()
...
#388
2023-03-10 07:36:50 -08:00
Ryan Barrett
ffd8810b44
start to separate logic from protocols with new Protocol/ActivityPub classes
...
for #388
2023-03-10 07:36:50 -08:00
Ryan Barrett
bc15902bed
bug fix, don't deliver activities to users if their Follower is inactive
2023-03-04 12:12:45 -08:00
Ryan Barrett
fa2a9a1afe
activitypub: store Create inner objects in their own Objects
2023-03-03 15:12:51 -08:00
Ryan Barrett
2dfddec2ef
convert activitypub.py logic to use all AS1
2023-03-03 09:28:40 -08:00
Ryan Barrett
0235d31a1c
noop: activitypub.py: extract sig verif out into a new verify_signature() fn
2023-02-26 20:41:57 -06:00
Ryan Barrett
116cd55ddb
finally start actually requiring HTTP Signatures
...
fixes #315
2023-02-26 07:34:15 -06:00
Ryan Barrett
fd27dabe61
switch JSON properties to custom JSONProperty that works in web console UI
...
https://github.com/googleapis/python-ndb/issues/874#issuecomment-1442753255
2023-02-24 07:25:29 -06:00
Ryan Barrett
91a60c7e67
switch Object.as1 to be a ComputedProperty
2023-02-23 21:17:26 -06:00
Ryan Barrett
1f3bd41dc5
common.redirect_unwrap: stop following redirects when unwrapping actor URLs
2023-02-23 08:35:06 -06:00
Ryan Barrett
74b3b3b689
refactoring, move Object creation out of common.send_webmentions
...
ugh this was painful
2023-02-23 07:44:54 -06:00
Ryan Barrett
3d3335e860
AP => webmention repost bug fix, merge follower and wm domains
2023-02-23 07:39:26 -06:00
Ryan Barrett
4982906ed8
AP => webmention, reposts: handle loading original federated posts
...
bug fix for 72eb26e248
2023-02-21 21:57:38 -06:00
Ryan Barrett
72eb26e248
AP => webmention, bug fix for sending webmentions for reposts
...
thanks to @tantek for reporting!
2023-02-21 21:19:56 -06:00
Ryan Barrett
65bbc6751e
HTTP Signature verification: bug fix, use actual HTTP method
2023-02-16 07:34:12 -08:00
Ryan Barrett
d505b3859a
HTTP Signature verification: fetch and use keyId from signature
...
#315
2023-02-15 20:10:17 -08:00
Ryan Barrett
e1560587bf
AP: rearrange HTTP Signature logging
...
#315
2023-02-15 15:48:12 -08:00
Ryan Barrett
e5d3f94b3e
AP signature verification: just log for now, don't fail
...
for #315
2023-02-15 14:10:25 -08:00
Ryan Barrett
63d0e59c2c
AP: verify incoming signatures!
...
for #315
2023-02-15 14:10:25 -08:00
Ryan Barrett
e423bde6d0
unify logging for writing datastore entities into post put hook
...
and other logging tweaks
2023-02-14 15:38:42 -08:00
Ryan Barrett
588598c5ff
switch most uses of common.get_as2 to common.get_object
2023-02-14 14:56:27 -08:00
Ryan Barrett
c2e6174330
add common.get_object()
2023-02-14 14:30:00 -08:00
Ryan Barrett
c12bb6db6d
serve AS2 /[domain] actors from datastore instead of refetching h-card
...
for #392 . not pretty, but gets the job done. more code cleanup needed eventually.
2023-02-14 08:25:41 -08:00
Ryan Barrett
6446c8c421
convert Object.type and .object_ids to ComputedPropertys
...
https://googleapis.dev/python/python-ndb/latest/model.html#google.cloud.ndb.model.ComputedProperty
2023-02-13 21:43:49 -08:00
Ryan Barrett
46ab1cfdf7
AP inbox: simplify already-seen-id handling
2023-02-13 19:10:01 -08:00
Ryan Barrett
e39a92cee2
optimize AP inbox delivery by moving user load back further down
2023-02-13 11:25:33 -08:00
Ryan Barrett
c305dcc8d5
AP inbox delivery: cache activity ids that we've already seen in memory
...
for #411
2023-02-12 22:17:04 -08:00
Ryan Barrett
7a625c5a02
AP inbox delivery: short circuit out if we've already seen the activity id
...
for #411 . next is caching in memory.
2023-02-12 21:58:59 -08:00
Ryan Barrett
bf97c1af4f
store all incoming AP activities in Objects
2023-02-11 22:53:50 -08:00
Ryan Barrett
3feb44e414
apply AP Updates to stored Objects in datastore
...
for #409
2023-02-11 22:23:01 -08:00
Ryan Barrett
7e2fbd1ed0
make AP Deletes mark stored Objects deleted
...
for #409
2023-02-11 21:47:55 -08:00
Ryan Barrett
45fc9786a2
activitypub: fetch full objects of reposts so we can render them in feeds
...
for #419
2023-02-11 19:58:07 -08:00
Ryan Barrett
cb66a2f33b
fix delivering reposts to followers
...
evidently broken by #286 . fixes #418
2023-02-08 11:03:54 -08:00
Ryan Barrett
b739bd4cee
return 404 on requests for unknown users instead of automatically creating them
2023-02-07 18:28:52 -08:00
Ryan Barrett
532ccb8ac1
Activity => Object: use StructuredProperty for Object.delivered etc, add protocol
...
#286
ndb implements StructuredProperty by hoisting each nested property into a
corresponding property on the parent entity, prefixed by the StructuredProperty's
name, eg delivered.uri, delivered.protocol, etc.
For repeated StructuredPropertys, the hoisted properties are all repeated on the
parent entity, and reconstructed into StructuredPropertys based on their order.
https://googleapis.dev/python/python-ndb/latest/model.html#google.cloud.ndb.model.StructuredProperty
2023-02-04 20:46:27 -08:00
Ryan Barrett
f9891b6ef7
Activity => Object: add activity label, unify Objects for AP => wm
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
4d2fcdd76f
Activity => Object: fully populate labels, source_protocol webmention
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
97ffc10f72
Activity => Object: populate Object.object_ids property
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
eafba6d7cd
Activity => Object: populate Object.type
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
060ad96752
Activity => Object: update activitypub.py
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
d724ae8cba
accept Updates to Person objects, do nothing with them
...
fixes #387
2023-01-25 19:44:48 -08:00
Ryan Barrett
d85ffaec04
implement stub empty outbox
...
for #383
2023-01-25 13:12:24 -08:00
Ryan Barrett
55d5206188
cache 502s and 504s for requests that fetch users' sites
...
for #378
2023-01-24 16:29:19 -08:00
Ryan Barrett
bb2d3e03de
noop: convert a few %s'es to f-strings
...
thanks flynt! https://github.com/ikamensh/flynt
2023-01-24 12:17:24 -08:00
Ryan Barrett
1627ff667a
translate webmention from home page into profile (actor) Update
...
for #376 , #331
2023-01-23 16:09:25 -08:00
Ryan Barrett
af769de99e
implement rest of followers/following collections
...
for #264
2023-01-20 07:02:55 -08:00
Ryan Barrett
74ebbc428b
add new common.fetch_followers() fn, use in UI, AP collections, and XRPCs
...
for #264
2023-01-19 15:29:52 -08:00
Ryan Barrett
fc4e8b11d2
return actors in AP Followers/Following collections
...
for #264 . next: paging
2023-01-19 07:00:35 -08:00
Ryan Barrett
84606500fa
refactoring: unify followers and following AP collection endpoints
2023-01-18 20:32:23 -08:00
Ryan Barrett
6520331627
incoming Follows: synthesize url into follow object stored in Activity
...
rendered mf2 HTML proxy pages (in render.py) fall back to redirecting to the follow's AS2 id field, but Mastodon's ids are URLs that don't load in browsers, eg https://jawns.club/ac33c547-ca6b-4351-80d5-d11a6879a7b0 . so, set a synthetic URL based on the follower's profile. fixes #336
2023-01-12 12:28:34 -08:00
Ryan Barrett
4e539488a7
inbound AP: handle Undo Follow with composite inner object
2023-01-09 22:58:35 -08:00
Ryan Barrett
8cdc5ecc4c
inbound AP: handle Follow with composite object
2023-01-08 17:41:15 -08:00
Ryan Barrett
9bb82e6db3
follow UI: store last_follow, misc bug fixes
2023-01-08 12:03:56 -08:00
Ryan Barrett
aa0dcbb222
noop: drop content type constants in common, use granary's instead
2023-01-06 21:01:33 -08:00
Ryan Barrett
7ac1006021
background task bug fix: override task runner host
...
we were using request.host_url blindly, which was fed.brid.gy for user-facing requests, but bridgy-federated.uc.r.appspot.com for tasks. #335
2023-01-05 15:05:35 -08:00
Ryan Barrett
4c383a3037
request caching tweaks, webfinger, use new flask_util.cached headers kwarg
2022-12-26 13:34:50 -08:00
Ryan Barrett
dc9c699d4f
/inbox: wait until later to load user from datastore
...
optimizes Accepts and Deletes sent to individual inbox that don't need the user
2022-12-08 09:00:53 -08:00
Ryan Barrett
a95c2c4b55
incoming follow bug fix, handle www and use_instead
...
fixes #314
2022-12-06 14:09:44 -08:00
Ryan Barrett
0363db65fa
handle new multi-valued url field in AS2 objects
...
snarfed/granary@79c512402b
2022-11-30 21:04:41 -08:00
Ryan Barrett
ab834f586a
incoming AP Follow bug fix, reactivate if Follower exists and is inactive
...
thanks again @gregorLove!
2022-11-29 22:43:11 -08:00
Ryan Barrett
559f02ad1d
AP actor handler: handle bad domain
...
https://console.cloud.google.com/errors/detail/CKGv-b6impW3Jg;time=P30D?project=bridgy-federated
2022-11-28 17:27:55 -08:00
Ryan Barrett
2fdc6f29a9
sign HTTP GET requests for AS2 objects
...
to support Mastodon's AUTHORIZED_FETCH aka secure mode: https://docs.joinmastodon.org/admin/config/#authorized_fetch
fixes #291
2022-11-24 09:41:14 -08:00
Ryan Barrett
2279db46fc
start on AP followers/following collections
...
for #264
2022-11-21 18:47:08 -08:00