Ryan Barrett
d1691b65c5
Object post put hook: don't add fragment ids to the common.get_object cache
2023-02-16 12:21:27 -08:00
Ryan Barrett
c540a8bee8
add test that Object put hook clears common.get_object cache
2023-02-16 08:21:56 -08:00
Ryan Barrett
65bbc6751e
HTTP Signature verification: bug fix, use actual HTTP method
2023-02-16 07:34:12 -08:00
dependabot[bot]
8f03c0aad3
build(deps): bump flask from 2.2.2 to 2.2.3
...
Bumps [flask](https://github.com/pallets/flask ) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pallets/flask/releases )
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst )
- [Commits](https://github.com/pallets/flask/compare/2.2.2...2.2.3 )
---
updated-dependencies:
- dependency-name: flask
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 05:00:34 -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
48a7720f88
common.get_object: normalize ids by removing fragments
...
this is still underspecified and a bit inconsistent across fediverse implementations:
https://socialhub.activitypub.rocks/t/problems-posting-to-mastodon-inbox/801/11
> The reason might also be that your IDs aren’t permanent, as in, they contain a #fragment. Posts and their corresponding Create activities are supposed to be resolvable — which means one should be able to send a GET request to the ID URL and get the object back. This can’t be done with an URL that contains a fragment as the fragment is not a part of the HTTP exchange, it’s processed on the client.
https://socialhub.activitypub.rocks/t/problems-posting-to-mastodon-inbox/801/23
> I ran into this object id #fragment problem as well. It seems because of some URL normalization, Mastodon will remove the fragment, and drop any additional posts with different fragments (because they become the same url).
https://socialhub.activitypub.rocks/t/s2s-create-activity/1647/5
https://github.com/mastodon/mastodon/issues/13879 (open!)
https://github.com/w3c/activitypub/issues/224
nothing in the http sig spec, example key ids aren't even URLs there:
https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures-16
2023-02-15 20:00:12 -08:00
Ryan Barrett
e1560587bf
AP: rearrange HTTP Signature logging
...
#315
2023-02-15 15:48:12 -08:00
Ryan Barrett
a7e96f585c
HTTP sig verification test: switch from assertLogs to mock
...
assertLogs was great, but didn't work when logging was disabled, eg by oauth_dropins.webutil.tests.__init__.py for python -m unittest discover.
I tried hard to override that and make it work, example code below, but couldn't get it to work. assertLogs() evidently needs a real handler, eg not NullHandler, but the default stderr stream handler that basicConfig() adds obviously emits to stderr.
print('@', logging.getLogger().hasHandlers())
logging_handlers = list(logging.getLogger().handlers)
logging.getLogger().handlers = []
logging_suppressed = logging.getLogger().isEnabledFor(logging.INFO)
logging.disable(logging.NOTSET)
handler = logging.NullHandler()
logging.getLogger().addHandler(handler)
activitypub.logger.disable(logging.NOTSET)
logging.getLogger().handlers = logging_handlers
logging.getLogger().removeHandler(handler)
if not logging_suppressed:
logging.disable(logging.CRITICAL + 1)
2023-02-15 14:10:25 -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
dependabot[bot]
ebcc3a0584
build(deps): bump werkzeug from 2.2.2 to 2.2.3
...
Bumps [werkzeug](https://github.com/pallets/werkzeug ) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pallets/werkzeug/releases )
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst )
- [Commits](https://github.com/pallets/werkzeug/compare/2.2.2...2.2.3 )
---
updated-dependencies:
- dependency-name: werkzeug
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 05:00:50 -08:00
dependabot[bot]
482c9b2966
build(deps): bump soupsieve from 2.3.2.post1 to 2.4
...
Bumps [soupsieve](https://github.com/facelessuser/soupsieve ) from 2.3.2.post1 to 2.4.
- [Release notes](https://github.com/facelessuser/soupsieve/releases )
- [Commits](https://github.com/facelessuser/soupsieve/compare/2.3.2.post1...2.4 )
---
updated-dependencies:
- dependency-name: soupsieve
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 05:00:28 -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
47b83c4e51
common.get_object: update existing object if available
2023-02-14 15:26:25 -08:00
Ryan Barrett
f44aa3b39e
common.get_object: fall back to HTTP fetch if stored entity has no as2
...
also add more logging
2023-02-14 15:17:03 -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
a71cb31cff
deps: upgrade cachetools to 5.3.0
2023-02-14 13:59:41 -08:00
Ryan Barrett
cc77f48b30
precompute "user not found" 404 page
...
...since we get a ton of requests for non-existing users from weird open redirect referrers: #422
2023-02-14 12:52:14 -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
d64e5e875e
test_webmention: drop unused atom test data
2023-02-14 07:40:37 -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
6f91a2538d
AP inbox delivery: drop same-domain targets from Objects
2023-02-13 11:28:02 -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
f39c532ad3
add User.homepage, is_homepage()
2023-02-12 12:03:27 -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
cb6fe8c264
webfinger: minor noop cleanup
2023-02-11 18:59:19 -08:00
Ryan Barrett
6d2668e64d
serve /r/ URLs as AS2 from the datastore, don't fetch and convert on the fly
...
for #392 , #378
2023-02-11 18:35:34 -08:00
Ryan Barrett
d72540fde7
move Activity model to scripts/activity_model.py
2023-02-11 18:11:30 -08:00
Ryan Barrett
381ecae6ae
readme: remove dev setup error snippets, most of them are out of date
2023-02-11 07:50:09 -08:00
Ryan Barrett
ad63e23aeb
/webmention: check that user exists at the beginning, not the end
2023-02-10 10:53:39 -08:00
Ryan Barrett
95b1fd5a29
docs: fix typo introduced in d6bd15fc3a
2023-02-10 08:28:23 -08:00
Ryan Barrett
d6bd15fc3a
add docs for seeing how your posts look inside the fediverse
...
fixes #396
2023-02-10 08:20:49 -08:00
Ryan Barrett
5d455b7d18
switch webfinger to serve entirely out of Users in datastore
...
no more fetching and converting users' home pages on demand!
for #392 , helps #378
2023-02-09 20:00:58 -08:00
Ryan Barrett
fb324c10da
update /stats page to use Object
...
fixes https://console.cloud.google.com/errors/detail/CLq21NfkvMu0WA;time=P30D?project=bridgy-federated
2023-02-09 08:26:33 -08:00
Ryan Barrett
f16338fc57
fix crash on followers/following pages with before/after query params
...
fixes https://console.cloud.google.com/errors/detail/CPnW-eq837TnswE;time=P30D?project=bridgy-federated , introduced in a140a60a7f
2023-02-09 08:26:30 -08:00
dependabot[bot]
e4a85ab7ff
build(deps): bump redis from 4.5.0 to 4.5.1
...
Bumps [redis](https://github.com/redis/redis-py ) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/redis/redis-py/releases )
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES )
- [Commits](https://github.com/redis/redis-py/compare/v4.5.0...v4.5.1 )
---
updated-dependencies:
- dependency-name: redis
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-09 04:04:41 -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
a140a60a7f
fix propagating the ?address=... query param into following UI page
...
for #414
2023-02-08 12:21:45 -08:00
Ryan Barrett
cb66a2f33b
fix delivering reposts to followers
...
evidently broken by #286 . fixes #418
2023-02-08 11:03:54 -08:00
dependabot[bot]
8ad8d2623d
build(deps): bump redis from 4.4.2 to 4.5.0
...
Bumps [redis](https://github.com/redis/redis-py ) from 4.4.2 to 4.5.0.
- [Release notes](https://github.com/redis/redis-py/releases )
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES )
- [Commits](https://github.com/redis/redis-py/compare/v4.4.2...v4.5.0 )
---
updated-dependencies:
- dependency-name: redis
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-08 04:04:10 -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
dependabot[bot]
3f4c7fe63e
build(deps): bump websocket-client from 1.5.0 to 1.5.1
...
Bumps [websocket-client](https://github.com/websocket-client/websocket-client ) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases )
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog )
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.5.0...v1.5.1 )
---
updated-dependencies:
- dependency-name: websocket-client
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 14:08:33 -08:00
dependabot[bot]
0b9640a756
build(deps): bump humanize from 4.5.0 to 4.6.0
...
Bumps [humanize](https://github.com/python-humanize/humanize ) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/python-humanize/humanize/releases )
- [Commits](https://github.com/python-humanize/humanize/compare/4.5.0...4.6.0 )
---
updated-dependencies:
- dependency-name: humanize
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 14:08:03 -08:00