Wykres commitów

195 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett a08a76c672
Object.resolve_ids bug fix: handle both protocol LABEL and ABBREV 2023-11-12 10:33:08 -08:00
Ryan Barrett 535494f21b
Object.to_as1 from bsky: pass at:// uri so we get id/url more often
for #715
2023-11-09 20:50:48 -08:00
Ryan Barrett f97b837960
cache follower/following counts for 2h 2023-11-08 12:03:56 -08:00
Ryan Barrett d576d2b2e4
move pages.count_followers to User, use it in activitypub.actor 2023-11-08 11:56:01 -08:00
Ryan Barrett 98bb29b333
drop Object.proxy_url, switch callers to ids.translate_object_id 2023-11-06 12:18:11 -08:00
Ryan Barrett 1f6a227aee
Object.actor_link bug fix: handle composite url field
fixes https://console.cloud.google.com/errors/detail/CJTXq6ri48XtKQ;time=P30D?project=bridgy-federated
2023-11-03 06:53:33 -07:00
Ryan Barrett 4d44363693
fold Object.as_bsky into ATProto.convert, translate ids 2023-11-02 17:41:31 -07:00
Ryan Barrett 72e180f854
User/Object.get_copy: return key id if proto is the source protocol 2023-11-02 13:08:23 -07:00
Ryan Barrett 0ca49e837a
add Object.get_copy, User.get_copy 2023-11-02 13:08:23 -07:00
Ryan Barrett 9aff3122c0
noop: rename get_for_copy[ies] => get_for_original[s] 2023-11-02 13:08:23 -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 cfbfba654e
move User.get_for_copy/ies to module level, add Object results 2023-10-26 16:00:03 -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 e833eb04dc
Object.resolve_ids: compact output objects with just id to bare string ids 2023-10-25 12:31:52 -07:00
Ryan Barrett 5a07e154ef
use subdomain_wrap in ids.convert 2023-10-24 15:58:03 -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 158200d9fd
bug fix for opt out, handle HTML 2023-10-21 20:51:54 -07:00
Ryan Barrett 1fa205af30
User.get_or_create: only fetch user profile if we don't already have it 2023-10-20 11:23:43 -07:00
Ryan Barrett efdf84a023
Protocol.receive: replace copy ids with originals, related bug fixes 2023-10-18 11:03:22 -07:00
Ryan Barrett ff88c082ef
try not clearing Object.bsky
now that we're starting to replace copies with originals in ids, actors, etc, it'd be nice to preserve the original source object data.
2023-10-18 11:03:22 -07:00
Ryan Barrett 96b84511eb
add Object.replace_copies_with_originals 2023-10-18 11:03:22 -07:00
Ryan Barrett f292a7d957
authorization: allow actor to update/delete itself
for #566
2023-10-16 12:25:29 -07:00
Ryan Barrett d0da119b07
add opt out via #nobridge or #nobot text in user profile bio
fixes #666

(unfortunate issue number 😆)
2023-10-13 12:36:31 -07:00
Ryan Barrett ff168231d6
Object.actor_link: add image kwarg 2023-10-12 10:37:22 -07:00
Ryan Barrett 8f4c353936
Object.actor_link: add sized kwarg 2023-10-12 10:19:59 -07:00
Ryan Barrett 84e9b2bcfd
AP: strip @context from Object.as2 before storing in datastore
we don't do LD, and many other servers' @contexts are big, so this saves disk space.

fixes #426
2023-10-11 16:35:05 -07:00
Ryan Barrett dfab9f55d1
user page redesign: Object.actor_link: load actor from datastore
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett bd19cab870
Object.actor_link bug fix: handle actor/author objects with only id field
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett f37baeba58
user page redesign: misc tweaks
* separate source protocol from user in user labels
* make bridged protocol labels generic
* other visual tweaks

for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett afa16d3864
start redesigning user pages
for #442
2023-10-11 12:25:38 -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 37188f3cca
User.get_or_create: if propagate=True, always reload user profile remotely 2023-10-07 11:51:21 -07:00
Ryan Barrett db29ad7757
docs: fix docstring formatting, other tweaks 2023-10-05 23:32:31 -07:00
Ryan Barrett e00a4b52ba
ATProto: don't create DNS records if DEBUG is on 2023-10-05 15:55:31 -07:00
Ryan Barrett 7d8b1ba2e8
add fetch_blobs kwarg to Object.as_bsky 2023-10-05 15:47:04 -07:00
Ryan Barrett 000b08f9b2
when creating a new ATProto user, add a DNS _atproto TXT record for their handle 2023-10-04 13:54:20 -07:00
Ryan Barrett ae25baba8c
drop obsolete User.href, it was only for OStatus
🫗
2023-10-04 12:30:20 -07:00
Ryan Barrett b4d5ab15ef
ATProto: assert that we only store record type objects in the repo 2023-10-03 16:56:06 -07:00
Ryan Barrett 4b94b4397c
User.get_or_create: fetch and propagate user profile object 2023-09-29 11:32:28 -07:00
Ryan Barrett bfabfabea7
move creating a new ATProto user from ATProto.send to User.get_or_create
in progress, still need to load user profile object and write it to ATProto repo
2023-09-29 11:32:28 -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 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 021df15f7e
Object.as1 from bsky: pass repo DID, handle, PDS to granary 2023-09-24 20:02:09 -07:00
Ryan Barrett c1880569b8
User.get_by_copy => get_by_copies 2023-09-19 21:12:53 -07:00
Ryan Barrett 5107d003fe
Object.as1: genericize converting actor/author id from copy to original 2023-09-19 19:59:28 -07:00
Ryan Barrett 134416cd7b
genericize User.get_by_atproto_did to get_for_copy 2023-09-19 16:48:16 -07:00
Ryan Barrett dcbf16db6e
Object.as1 conversion from bsky, injecting actor/author
prefer user id to profile object id, default to AT URI repo DID
2023-09-18 11:52:17 -07:00
Ryan Barrett 5b16386fbc
User.get_by_atproto_did and Object.as1 from bsky: support native ATProto users 2023-09-18 11:41:01 -07:00
Ryan Barrett a723be660e
Object.as1: inject actor/author when converting from bsky objects
...since they imply actor/author in the AT URI's repo DID.
2023-09-18 11:23:11 -07:00
Ryan Barrett 48e47f5f7d
add User.get_by_atproto_did 2023-09-17 22:38:33 -07:00
Ryan Barrett 61b585e715
for Objects for ATProto records, require at:// URIs to have DID repos
don't allow handles. https://atproto.com/specs/at-uri-scheme
2023-09-13 12:51:34 -07:00
Ryan Barrett 165a403353
drop User.k256_pem, use arroba's AtpRepo.signing_key/rotation_key instead 2023-09-08 21:52:46 -07:00
Ryan Barrett abf583952c
first pass at ATProto.send 2023-09-01 12:07:21 -07:00
Ryan Barrett 3ff42f0cd4
User.p256_key = k256_key, for ATProto 2023-09-01 07:51:23 -07:00
Ryan Barrett fd4b40fe7c
implement default User.ap_actor() 2023-08-31 11:49:10 -07:00
Ryan Barrett 9211aa3cae
bug fixes for Object.clear and get_or_create
be more careful about clearing and preserving as2/mf2/bsky/our_as1 properties

discovered by @jamietanna, thanks for reporting Jamie!
2023-08-08 10:26:00 -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 b57c96d7d5
move AtpNode to arroba 2023-07-26 09:02:23 -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 57350ab81a
switch from Object.users + labels to users + notify + feed lists
needed to distinguish an activity's owners from who it should notify from who should see it in their feeds.

also, unrelated, start sending stop-following activities.

in progress, test_web and test_activitypub still need updating.
2023-07-17 05:34:56 -10:00
Ryan Barrett 42bb4a765d
misc test fixes 2023-07-11 13:25:31 -07:00
Ryan Barrett 89ff89ef30
merging receive: Object.as1: postprocess mf2, if no id, use url
for #529
2023-07-11 13:25:31 -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 3f9ee02126
Object.get_or_create: populate .new and .changed 2023-07-11 13:25:29 -07:00
Ryan Barrett 3ceeae418f
add Object.activity_changed 2023-07-11 13:25:29 -07:00
Ryan Barrett 80e63e0fe9
add Object.get_or_create 2023-07-11 13:25:29 -07:00
Ryan Barrett ee52a7b1c6
User.load_multi bug fix: handle when obj_key points to nonexistent entity
fixes https://console.cloud.google.com/errors/detail/COGUnu_nvbzluwE;time=P30D?project=bridgy-federated
2023-06-29 13:47:16 -07:00
Ryan Barrett a5466e34ca
minor noop refactoring to web._targets() to make it use Target directly 2023-06-28 14:45:14 -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 65b4f1495f
Protocol.receive: fail "intra-BF" activities from ourselves
for #558
2023-06-23 11:20:29 -07:00
Ryan Barrett cba4845394
disable ndb in-memory cache
it has a bug/weird behavior that we want to avoid, at least for now.

https://github.com/googleapis/python-ndb/issues/888
https://github.com/snarfed/bridgy-fed/issues/558
2023-06-22 14:27:02 -07:00
Ryan Barrett c97ee862a5
Protocol.load: return copies of cached objects, not the originals
...so that modifications aren't durable in memory until we put() them. for #558
2023-06-22 12:30:25 -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 1821e90f36
add Object.as_as2() 2023-06-16 14:09:28 -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 65e1479d88
don't allow Followers from and to the same protocol
also make from and to required
2023-06-13 20:58:28 -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 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 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 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 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 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 56f18f5d9a
AP users: make User.ap_actor/ap_address abstract, implement in subclasses
for #512
2023-05-31 10:47:09 -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 8d4228b811
AP users: change web UI user page paths from /user/... to /[protocol]/...
for #512
2023-05-30 14:08:47 -07:00
Ryan Barrett 47b04f5574
rename Web.LABEL from 'webmention' to 'web' 2023-05-30 12:15:36 -07:00
Ryan Barrett 93f621aaf5
AP users: start to replace external with indirect, starting with webfinger
#512
2023-05-29 20:16:15 -07:00
Ryan Barrett 624355d85a
AP users: add new User.direct property
direct users signed up or otherwise interacted with BF explicitly, indirect users didn't
2023-05-29 19:37:41 -07:00
Ryan Barrett eaa4e5333a
start to make User subclasses for each protocol
#512
2023-05-26 16:07:36 -07:00
Ryan Barrett 15e3daff5e
switch outbound webmention source URLs from /render?id=... to /convert/...
#512
2023-05-24 16:32:00 -07:00
Ryan Barrett f933c7e237
AP users: serve AS2 for external homepage URLs
#512
2023-05-22 23:17:42 -07:00
Ryan Barrett 0ab3698db7
Bluesky: move most ATProto code to separate arroba library
https://github.com/snarfed/arroba
2023-05-06 14:41:06 -07:00
Ryan Barrett 64f4f62ae9
bluesky: add models.AtpNode for storing repo blocks 2023-04-28 12:02:26 -07:00
Ryan Barrett e303f55fdf
models.User: generate and store an ECC P-256 keypair
for AT Proto
2023-04-25 14:04:29 -07:00