Wykres commitów

66 Commity (60c3bf59482a0805c5ee8f9c8583bd4a4db764a3)

Autor SHA1 Wiadomość Data
Ryan Barrett f951c143e3
fix tests for 0902994af0 2023-06-12 15:50:47 -07:00
Ryan Barrett 0902994af0
webfinger: infer protocol from brid.gy subdomain in request or resource
first commit for inferring protocol. exciting! for #512
2023-06-12 15:50:00 -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 cb5e7bf8c7
noop, minor protocol generalization and cleanup
for #512
2023-06-10 15:07:26 -07:00
Ryan Barrett 788da1fe66
suppress bs4.MarkupResemblesLocatorWarning in WebTest.test_create_author_only_url
```
local/lib/python3.9/site-packages/bs4/__init__.py:435: MarkupResemblesLocatorWarning: The input looks more like a filename than markup. You may want to open this file and pass the filehandle into Beautiful Soup.
```
2023-06-08 21:21:40 -07:00
Ryan Barrett 0bcd63af04
testutil: hide stdlib and virtualenv lines in test failures tracebacks 2023-06-07 19:06:50 -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 4d2f26eff0
noop test refactoring: convert test_web test data from self attrs to constants
long overdue!
2023-06-05 19:06:21 -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 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 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 93f621aaf5
AP users: start to replace external with indirect, starting with webfinger
#512
2023-05-29 20:16:15 -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 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 abd822eee6
atproto: unify test setup (random seeds, test data) into testutil 2023-04-30 12:20:58 -07:00
Ryan Barrett 412f3416a4
big steps toward getting getRepo working
* generate commits
* sign commits
* serialize and include MST after each commit, not just at the end

phew!
2023-04-27 16:48:25 -07:00
Ryan Barrett 2758acc6cb
wm => AP bug fix: if source has multiple u-follow-ofs, store individual last_follows
fixes https://console.cloud.google.com/errors/detail/COGA_MbTzeDJqgE;time=P30D?project=bridgy-federated
2023-04-23 21:13:11 -07:00
Ryan Barrett 3493aafca8
Bluesky: implement com.atproto.sync.getRepo
first com.atproto.sync XRPC! 🎉
2023-04-20 19:28:39 -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 b39d673f12
add Object.expire property for datastore TTL to garbage collect old Objects
right now, auto-delete some ephemeral activities after 90d. for #456. https://cloud.google.com/datastore/docs/ttl
2023-04-18 09:16:16 -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 3a97ba587d
noop: Protocol.load: switch from @cached decorator to manual cache
...so that I can add a refresh kwarg that bypasses the cache
2023-04-02 20:36:23 -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 68de408789
Protocol.get_object(): store object before returning
also flesh out FakeProtocol

hopefully helps with https://console.cloud.google.com/errors/detail/CKCN17fmoZHraw;time=P30D?project=bridgy-federated , don't really know though
2023-03-27 14:14:37 -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 acf474e2a9
standardize fetch(id, obj) args 2023-03-20 19:25:05 -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 bf15f4ca95
fix wm => AP reposts
fixes #453
2023-03-19 16:21:44 -07:00
Ryan Barrett aeb2fd480a
tests: rename remaining test data hostnames to clarify web vs fediverse
followup to f6e5727602
2023-03-19 15:43:55 -07:00
Ryan Barrett 2e79512f55
testutil: stub out FakeProtocol class 2023-03-13 17:23:57 -07:00
Ryan Barrett 76e26a7c2c
cache webmention endpoint discovery for 2h 2023-03-10 22:24:58 -08:00
Ryan Barrett 106bbe623b
tests optimization: reuse same RSA key across Users
speeds up tests from ~22s to ~6s (!) on my laptop. for #398
2023-03-10 15:13:45 -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 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 63d0e59c2c
AP: verify incoming signatures!
for #315
2023-02-15 14:10:25 -08:00
Ryan Barrett c2e6174330
add common.get_object() 2023-02-14 14:30:00 -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 7e2fbd1ed0
make AP Deletes mark stored Objects deleted
for #409
2023-02-11 21:47:55 -08:00
Ryan Barrett d5eac953d0
more error handling for signup UI flow when user's web site fetch fails
fixes #400
2023-02-08 20:28:30 -08:00
Ryan Barrett 4b37674624
always sign requests with current user's key, stop defaulting to snarfed.org
for #403
2023-02-06 19:23:25 -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 eafba6d7cd
Activity => Object: populate Object.type
#286
2023-02-04 20:46:27 -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