Wykres commitów

935 Commity (42c648284d7332eaeefcf651aa6d880df68f9fce)

Autor SHA1 Wiadomość Data
Ryan Barrett 42c648284d
noop TODO comment 2023-02-24 11:51:24 -06:00
Ryan Barrett 7bb9785327
fix log message for Object.as2 vs mf2 vs bluesky 2023-02-24 11:48:48 -06:00
Ryan Barrett 76927ee487
Object.as1: temporarily demote assert to warning log 2023-02-24 10:02:06 -06:00
Ryan Barrett 5463a74e7e
switch Object.as1 to custom ComputedJsonProperty 2023-02-24 08:25:18 -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 6500f71d3f
switch bluesky XRPCs to serve from datastore
fixes #421
2023-02-23 07:39:50 -06:00
Ryan Barrett 3d3335e860
AP => webmention repost bug fix, merge follower and wm domains 2023-02-23 07:39:26 -06:00
dependabot[bot] c2fc13a10c build(deps): bump grpcio from 1.51.1 to 1.51.3
Bumps [grpcio](https://github.com/grpc/grpc) from 1.51.1 to 1.51.3.
- [Release notes](https://github.com/grpc/grpc/releases)
- [Changelog](https://github.com/grpc/grpc/blob/master/doc/grpc_release_schedule.md)
- [Commits](https://github.com/grpc/grpc/compare/v1.51.1...v1.51.3)

---
updated-dependencies:
- dependency-name: grpcio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-22 04:16:36 -08: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 88db2afce3
follow/unfollow UI: store IndieAuth in session cookie
fixes #416
2023-02-17 16:12:25 -08:00
Ryan Barrett e31be9b955
webfinger: minor noop simplification 2023-02-16 20:29:41 -08:00
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