Wykres commitów

66 Commity (ae719f85a56012fed6324fd76218435bf011f6a2)

Autor SHA1 Wiadomość Data
Ryan Barrett 795cb34ac1
webfinger: handle bad acct: URI
https://console.cloud.google.com/errors/detail/CKGv-b6impW3Jg;time=P30D?project=bridgy-federated
2022-11-28 17:27:58 -08:00
Ryan Barrett 7d902ec616
bug fix for custom username in fediverse address on user page UI
should come from acct: actor URL, not preferredUsername field, which always has to be user's domain for AP interop.

in the process, refactored common.get_username() into User.username().

for #281
2022-11-26 16:05:02 -08:00
Ryan Barrett 18a80d09fb
webfinger error handling: return 400 on ?resource=acct:@fed.brid.gy
fixes https://console.cloud.google.com/errors/detail/CPn404XJ2rC6rAE;time=P30D?project=bridgy-federated
2022-11-26 06:59:27 -08:00
Ryan Barrett 8c258816d1
webfinger error handling: return 400 on ?resource=https://fed.brid.gy/
fixes https://console.cloud.google.com/errors/detail/CPn404XJ2rC6rAE;time=P30D?project=bridgy-federated
2022-11-25 08:00:14 -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 65f3ef3cc7
show fediverse address on user page UI, including custom username
for #281
2022-11-20 11:46:05 -08:00
Ryan Barrett f127a17fe5
webfinger: handle Bridgy Fed actor URLs
hoping to fix errors like this on Mastodon AP delivery:
`Received 401: Public key not found for key https://fed.brid.gy/snarfed.org`
2022-11-17 14:56:05 -08:00
Ryan Barrett 2d9cc31ff9
switch default home page scheme from http to https
fixes #269
2022-11-16 10:43:34 -08:00
Ryan Barrett 320b117470
add AP sharedInbox
#285, https://www.w3.org/TR/activitypub/#sharedInbox
2022-11-16 10:09:24 -08:00
Ryan Barrett 50956c02b0
noop, rename Domain => User 2022-11-15 22:00:28 -08:00
Ryan Barrett e3f1431018
noop identifier renames, key => domain or entity 2022-11-15 19:12:20 -08:00
Ryan Barrett 4f3dc03a3e
rename MagicKey => Domain, Response => Activity
the Python classes, but not (yet) the kinds in the datastore. maybe eventually.
2022-11-12 15:27:59 -08:00
Ryan Barrett e767cf5d1f
refactor /responses and user pages, add follower counts to user pages
for #274
more to come
2022-11-11 21:13:51 -08:00
Ryan Barrett 96dba41c9b
logging: use separate loggers for each module with their names 2022-02-11 22:38:56 -08:00
Ryan Barrett 2f28be09be
convert %-formatted strings with args in logging.* calls to f-strings 2021-12-27 22:45:57 -08:00
Ryan Barrett cf12817212
Flask port: error handling bug fixes, other misc tweaks 2021-08-16 11:47:31 -07:00
Ryan Barrett 32d9e2bf6c
move common.error() to webutil.flask_util
corresponds to snarfed/webutil@10c088cebd
2021-08-06 11:01:58 -07:00
Ryan Barrett 40ad6a4afa
move handle_exception and default_modern_headers to webutil
corresponds to snarfed/webutil@cdcaa3e897
2021-07-27 21:58:05 -07:00
Ryan Barrett 2e3360a54b
move Flask utils to oauth_dropins.webutil.flask_util
corresponds to snarfed/webutil@5574bb23fa
2021-07-17 21:22:13 -07:00
Ryan Barrett e1aace0655
flask: use new regex URL route converter 2021-07-12 14:25:00 -07:00
Ryan Barrett 4a55739b91
flask: port /.well-known/host-meta*, other misc tweaks
all tests pass!
2021-07-11 16:50:44 -07:00
Ryan Barrett 371a92a5db
flask: port XrdOrJrdHandler, finish porting webfinger 2021-07-11 16:30:14 -07:00
Ryan Barrett 007f8f16fd
flask: first pass at porting webfinger; incomplete!
incomplete because I also need to port webutil.handlers.XrdOrJrdHandler
2021-07-11 13:39:19 -07:00
Ryan Barrett 4fffc073d2
flask: port webmention, add exception handler 2021-07-11 08:48:28 -07:00
Ryan Barrett f26aed5cbb
flask: port salmon 2021-07-08 22:50:33 -07:00
Ryan Barrett 4a0ef5cb7c
minor bug fix for logging headers in webfinger 2021-03-12 20:44:51 -08:00
Ryan Barrett 17fa355226
webfinger: misc noop comment and test tweaks 2021-03-12 14:35:59 -08:00
Ryan Barrett a4fede524f
webfinger: add XRD support
for #12
2021-03-12 06:52:09 -08:00
Ryan Barrett 9b15ca181f
webfinger bug fix
fixes https://console.cloud.google.com/errors/CKftxaDNhcunOQ
2020-12-30 19:24:22 -08:00
Ryan Barrett c12b675a7a
webfinger: handle acct:[domain]@fed.brid.gy requests
fixes #73
2020-12-30 10:26:48 -08:00
Ryan Barrett df6b0b58ba
unify request handler classes and handle_exception; move away from HOST[_URL]
fixes:
* https://console.cloud.google.com/errors/CN68rO-5sOK9cQ
* https://console.cloud.google.com/errors/CJWCu8b5_ureAg
* https://console.cloud.google.com/errors/CN6W4Zy7irzgOA
* https://console.cloud.google.com/errors/CN278MyjhZbtOQ
2020-01-31 14:40:11 -08:00
Ryan Barrett ee7b324525
bring back HOST_URL override to fed.brid.gy, for URLs emitted into AP 2019-12-26 18:18:44 -08:00
Ryan Barrett 02d36b3b1f
migrate to the app engine standard python 3 runtime!
https://cloud.google.com/appengine/docs/standard/python3/python-differences
https://cloud.google.com/appengine/docs/standard/python/migrate-to-python3/
2019-12-25 22:26:26 -08:00
Ryan Barrett ab55c9d62c
ujson.dumps/loads() => util.json_dumps/loads() 2019-12-24 23:26:58 -08:00
Ryan Barrett 99a5c35ae3
switch from webutil.util.memcache_response to cache_response 2019-11-12 21:28:44 -08:00
Ryan Barrett faf676e8bb
switch from json to ultrajson for performance
https://github.com/esnme/ultrajson/
2019-10-29 07:06:15 -07:00
Ryan Barrett 7c9a03c827
unify HTTP fetching, HTML and mf2 parsing, and error handling into webutil
see:
* snarfed/granary#171
* snarfed/webutil@f994884b2b
* snarfed/oauth-dropins@f5b6e73530
* snarfed/granary@284eb11508
2019-10-03 21:08:26 -07:00
Ryan Barrett c623a295c6
misc noop cleanups based on LGTM alerts
https://lgtm.com/projects/g/snarfed/bridgy/?mode=list
2019-09-19 11:57:16 -07:00
Ryan Barrett c055f3aeba
drop HTML tags from webfinger error messages
fixes #53
2019-06-24 14:46:45 -07:00
Ryan Barrett 801bf4075d
detect non-domain requests, eg /nodeinfo.json, and 404
these are probably other mastodon instances assuming we're mastodon too.
2019-04-19 08:00:21 -07:00
Ryan Barrett 76686af538
cache lots of GET requests
this helps with requests that make external HTTP fetches, eg indieweb home pages/posts and federated profiles/posts, which change rarely.

in particular, outbound AP requests that get federated widely (eg Mastodon) result in all of those federated instances making the same bridgy fed requests at the same time, often within just a few seconds. more background: tootsuite/mastodon#4486
2019-04-16 11:05:18 -07:00
Ryan Barrett 5047337738
upgrade BS4 to 4.6.3, pin lxml to app engine prod's version 2018-10-11 17:03:26 -07:00
Stephen Paul Weber 38ff56e3cc Use the acct: URI for this domain, if in h-card
This allows users to choose their own username for their webfinger ID.

Closes #3
2018-04-16 11:10:03 -05:00
Ryan Barrett d0ac9246a8 granary-demo.appspot.com 2017-11-25 15:42:53 -08:00
Ryan Barrett 29fb93ca92 change username from 'me' to web site domain
for #3, tootsuite/mastodon#5523
2017-10-26 17:07:57 -07:00
Ryan Barrett 530969da1b use non-unicode strings for Content-Type values
...because App Engine's wsgi.py requires header values to be str, not unicode.

also improve logic for whether to log HTTP response bodies.
2017-10-20 18:05:51 -07:00
Ryan Barrett c81a6b8ed2 activitypub: follow HTML link rels that point to AS2 objects
...by reusing common.get_as2(). also lots of misc refactoring.
2017-10-20 12:49:48 -07:00
Ryan Barrett c47e07ab94 webfinger: check domain home page too; preserve port in MagicKey domain 2017-10-04 09:12:08 -07:00
Ryan Barrett fcef1e84ec switch from request.host_url to appengine_config.HOST_URL
...because for requests that were redirected, request.host_url would sometimes lose port. no clue how or why.

e.g. testing mastodon interop locally with me@www.brid.gy, mastodon would fetch

  https://www.brid.gy/.well-known/webfinger?resource=acct:me@www.brid.gy

which would 302 redirect to

  http://localhost:8080/.well-known/webfinger?resource=acct:me@www.brid.gy

and in that request, request.host_url would be http://localhost. but if i curled that second webfinger URL directly, request.host_url would be http://localhost:8080. weird.
2017-09-30 07:56:40 -07:00
Ryan Barrett c998901108 update webfinger, AS2, etc for receiving AP 2017-09-28 07:25:21 -07:00