Wykres commitów

1076 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett 4d2fcdd76f
Activity => Object: fully populate labels, source_protocol webmention
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett a76fe45891
Activity => Object: finish ap_delivered, ap_undelivered, ap_failed
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 97ffc10f72
Activity => Object: populate Object.object_ids property
#286
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 d72be97d78
Activity => Object: populate ap_* fields for inbox delivery results
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 94a74b9800
noop: test_webmention: switch more asserts to assert_object() 2023-02-04 20:46:27 -08:00
Ryan Barrett 9d4e73344b
Activity => Object: populate ap_delivered, ap_undelivered, ap_failed
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 58e836b380
Activity => Object: update webmention.py
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 060ad96752
Activity => Object: update activitypub.py
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 8176cd1f56
Activity => Object: update pages.py
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett 23aff3b176
Activity => Object: update follow.py 2023-02-04 20:46:27 -08:00
Ryan Barrett d655ea0024
Activity => Object: update xrpc_feed.py
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett cc453035c8
initial design of new Object model, implement it in render.py 2023-02-04 20:46:27 -08:00
Ryan Barrett 55ee0e468a
update follow tests for snarfed/oauth-dropins@52b00f602f 2023-02-04 20:46:10 -08:00
Ryan Barrett 82547c9557
override User.get_by_id() to handle use_instead
fixes #403
2023-02-04 19:53:30 -08:00
Ryan Barrett d523cc085a
remove OStatus parts of Webfinger
background on Mastodon interop:
* https://docs.joinmastodon.org/spec/webfinger/
* https://github.com/mastodon/mastodon/pull/11280
* https://docs.joinmastodon.org/spec/activitypub/#publicKey
2023-01-25 20:59:40 -08:00
Ryan Barrett f0a5f1745e
webfinger: return data even if site has no representative h-card
fixes #384
2023-01-25 20:41:29 -08:00
Ryan Barrett 38c7c1bc5f
webfinger: return 404 if User not found
for #384
2023-01-25 20:00:54 -08:00
Ryan Barrett d724ae8cba
accept Updates to Person objects, do nothing with them
fixes #387
2023-01-25 19:44:48 -08:00
Ryan Barrett d85ffaec04
implement stub empty outbox
for #383
2023-01-25 13:12:24 -08:00
Ryan Barrett 05c8dc83c4
override link label for home page to be "Web site"
for #331
2023-01-25 12:33:53 -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
Ryan Barrett 46736df21b
common.postprocess_as2 bug fix, handle multiply valued image field 2023-01-23 21:13:05 -08:00
Ryan Barrett 0d0a4ed642
update profile bug fix: always populate object.updated field
for #376
2023-01-23 20:53:34 -08:00
Ryan Barrett e6889b4cf6
activities UI bug fix for rendering profile updates 2023-01-23 20:46:12 -08:00
Ryan Barrett 378bb5dbf4
activities UI: handle empty Activity, source_mf2 without `items`
for #376
2023-01-23 19:20:31 -08:00
Ryan Barrett 1627ff667a
translate webmention from home page into profile (actor) Update
for #376, #331
2023-01-23 16:09:25 -08:00
Ryan Barrett 21c79a304c
when converting h-card to actor, use link text or title for profile links
for #331
2023-01-22 07:47:27 -08:00
Ryan Barrett af769de99e
implement rest of followers/following collections
for #264
2023-01-20 07:02:55 -08:00
Ryan Barrett 74ebbc428b
add new common.fetch_followers() fn, use in UI, AP collections, and XRPCs
for #264
2023-01-19 15:29:52 -08:00
Ryan Barrett ea02b82f39
test_pages: add tests for followers/following UI pages 2023-01-19 15:25:56 -08:00
Ryan Barrett fc4e8b11d2
return actors in AP Followers/Following collections
for #264. next: paging
2023-01-19 07:00:35 -08:00
Ryan Barrett 36349a5db9
add Follower.to_as2() 2023-01-19 06:49:39 -08:00
Ryan Barrett c3edf3a68e
make Follower.to_as1() handle both inbound and outbound last_follow
...and use it in followers and following UI pages
2023-01-18 22:31:13 -08:00
Ryan Barrett f8fbf1391c
refactoring: unify followers and following UI page handlers 2023-01-18 21:25:54 -08:00
Ryan Barrett 37e389447a
always store Follower.last_follow as AP/AS2 Follow activity
specifically, this switches storing outbound follows from inbound webmentions from AS1 to AS2.
2023-01-18 21:09:43 -08:00
Ryan Barrett 2c9850c576
HTTP Signatures: add special (request-target) header
for #40, special synthetic HTTP header for HTTP Signatures, required by Peertube.
https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12#section-2.3
2023-01-17 19:50:40 -08:00
Ryan Barrett 5182bb92f3
Mastodon interop: fill in the updated field for Updates if it's missing
Mastodon requires it:
https://docs.joinmastodon.org/spec/activitypub/#supported-activities-for-statuses
https://socialhub.activitypub.rocks/t/what-could-be-the-reason-that-my-update-activity-does-not-work/2893/4
https://github.com/mastodon/documentation/pull/1150
2023-01-17 11:16:14 -08:00
Ryan Barrett e6d4441292
handle redirects of signed requests manually, generate a new HTTP sig each time
fixes #326
2023-01-16 13:10:33 -08:00
Ryan Barrett 2b2dfafc18
bluesky: app.bsky.graph.getFollowers, handle no user 2023-01-15 10:07:04 -08:00
Ryan Barrett c1148ee3de
bluesky: misc minor XPRC error handling 2023-01-13 20:12:44 -08:00
Ryan Barrett a66fe4bdc2
bluesky: implement app.bsky.feed.getTimeline
based on stored Activity entities. missing auth, otherwise pretty complete.
2023-01-13 15:35:05 -08:00
Ryan Barrett 8b5f62be4d
bluesky: implement app.bsky.graph.getFollows
almost identical to getFollowers
2023-01-13 14:11:49 -08:00
Ryan Barrett 898b8545ac
bluesky: implement app.bsky.graph.getFollowers 2023-01-13 11:40:52 -08:00
Ryan Barrett ef1c92222b
bridgy-at: integrate XRPC server, testutil, etc 2023-01-12 19:43:12 -08:00
Ryan Barrett 2cca37af1d
Merge snarfed/bridgy-at repo into bridgy-fed
Dropped most files, only kept XRPC implementations and tests.
2023-01-12 19:30:07 -08:00
Ryan Barrett 2bf2a77584
punt on getRepostedBy for now 2023-01-12 18:05:07 -08:00
Ryan Barrett 39d5485a52
implement empty stub for app.bsky.feed.getVotes 2023-01-12 16:47:30 -08:00
Ryan Barrett 64242f3deb
implement app.bsky.feed.getPostThread 2023-01-12 16:39:21 -08:00
Ryan Barrett 6520331627
incoming Follows: synthesize url into follow object stored in Activity
rendered mf2 HTML proxy pages (in render.py) fall back to redirecting to the follow's AS2 id field, but Mastodon's ids are URLs that don't load in browsers, eg https://jawns.club/ac33c547-ca6b-4351-80d5-d11a6879a7b0. so, set a synthetic URL based on the follower's profile. fixes #336
2023-01-12 12:28:34 -08:00
Ryan Barrett 4e539488a7
inbound AP: handle Undo Follow with composite inner object 2023-01-09 22:58:35 -08:00
Ryan Barrett d2eda25375
unfollow UI
#351

pretty complete, except for activity text snippet rendering
2023-01-09 22:58:35 -08:00
Ryan Barrett a14c58ac47
follow UI: use synthesized follow URL in Activity key id 2023-01-08 22:39:37 -08:00
Ryan Barrett 8cdc5ecc4c
inbound AP: handle Follow with composite object 2023-01-08 17:41:15 -08:00
Ryan Barrett a52df2c269
follow UI: handle URL inputs, eg https://indieweb.social/@snarfed
#351
2023-01-08 15:43:32 -08:00
Ryan Barrett 9bb82e6db3
follow UI: store last_follow, misc bug fixes 2023-01-08 12:03:56 -08:00
Ryan Barrett 91c4200bb3
follow UI: synthesize Follow activity id, store an Activity, link address, form bug fix 2023-01-08 07:11:22 -08:00
Ryan Barrett c50f0e0106
add follow UI to user/[domain]/following
for #351
2023-01-07 09:34:55 -08:00
Ryan Barrett 6e000d348d
noop: add TestCase.as2_resp(), refactor ActivityPubTest to use it 2023-01-07 09:18:11 -08:00
Ryan Barrett aa0dcbb222
noop: drop content type constants in common, use granary's instead 2023-01-06 21:01:33 -08:00
Ryan Barrett 7ac1006021
background task bug fix: override task runner host
we were using request.host_url blindly, which was fed.brid.gy for user-facing requests, but bridgy-federated.uc.r.appspot.com for tasks. #335
2023-01-05 15:05:35 -08:00
Ryan Barrett 512737cc99
add task queue for delivering AP Creates and Updates to followers
fixes #335
2023-01-04 20:48:39 -08:00
Ryan Barrett fe5c3947a8
drop OStatus! it's been unused for years
fixes #282
2023-01-04 19:22:11 -08:00
Ryan Barrett 45f4bd71a2
switch common.utcnow to util.now 2023-01-03 15:41:43 -08:00
Ryan Barrett bb6dd119db
move test data to granary, drop unneeded method stubs 2022-12-30 22:52:56 -08:00
Ryan Barrett f55ef86524
finish implementing getAuthorFeed 2022-12-30 10:10:49 -08:00
Ryan Barrett e5b3307828
app.bsky.feed.getAuthorFeed, in progress 2022-12-28 17:30:22 -08:00
Ryan Barrett 6968d0cb51
stub actor.search and searchTypeahead 2022-12-28 13:11:17 -08:00
Ryan Barrett ab597d11c6
implement getSuggestions stub, switch tests to use Flask test client 2022-12-28 09:46:32 -08:00
Ryan Barrett 55dca2043e
implement actor.getProfile 2022-12-28 09:27:57 -08:00
Ryan Barrett 5f082349d5
/r/ handler: include Accept header in flask cache key
requires pending bug fix https://github.com/pallets-eco/flask-caching/pull/431
2022-12-26 09:52:08 -08:00
Ryan Barrett b86581306b
add XRPC server and method skeletons 2022-12-24 21:08:12 -08:00
Ryan Barrett b4cf56756e
prefix XRPC source files with xrpc_ 2022-12-24 13:38:42 -08:00
Ryan Barrett 0277675cee
initial code skeleton and app scaffolding, largely copied from Bridgy Fed 2022-12-24 08:34:39 -08:00
Ryan Barrett 22d1bcfe9d
incoming webmentions: error if source page fetch fails 2022-12-21 11:57:06 -08:00
Ryan Barrett d4741310e7
common.postprocess_as2 bug fix for multiply valued AS2 url field
fixes https://console.cloud.google.com/errors/detail/CMOZzPLojuud_QE;time=P30D?project=bridgy-federated
2022-12-11 07:28:30 -08:00
Ryan Barrett 8751fea257
harden URL unwrapping a bit, require http(s) URL or domain
fixes https://console.cloud.google.com/errors/detail/CMKn7tqbq-GIRA;time=P30D?project=bridgy-federated
2022-12-10 09:09:44 -08:00
Ryan Barrett 72b8dea8a0
Model.verify: minor redirect error message tweak 2022-12-06 22:41:55 -08:00
Ryan Barrett f72b3abfa0
Model.verify: add error message for non-2xx redirects
for #337
2022-12-06 22:37:56 -08:00
Ryan Barrett a95c2c4b55
incoming follow bug fix, handle www and use_instead
fixes #314
2022-12-06 14:09:44 -08:00
Ryan Barrett 222be38a98
user page: redirect www-stripped users to non-www user pages
for #314
2022-12-02 11:08:24 -08:00
Ryan Barrett 5249bb5a4f
special-case www subdomains, use root domain if it redirects to www
for #314
2022-12-02 10:48:16 -08:00
Ryan Barrett bd4d30f61c
add remote follow link rel to webfinger
https://socialhub.activitypub.rocks/t/what-is-the-current-spec-for-remote-follow/2020/11?u=snarfed
https://github.com/snarfed/bridgy-fed/issues/60#issuecomment-1325589750
and #60
2022-12-01 10:09:57 -08:00
Ryan Barrett 0363db65fa
handle new multi-valued url field in AS2 objects
snarfed/granary@79c512402b
2022-11-30 21:04:41 -08:00
Ryan Barrett 7f9977ee1c
update test for snarfed/granary@0ec0d00 2022-11-30 17:40:22 -08:00
Ryan Barrett dfedb985c7
update tests for
for snarfed/granary@3daa5c0963
2022-11-30 14:18:38 -08:00
Ryan Barrett 98fc3d7a7d
update tests for snarfed/granary@7e75ef85ce 2022-11-30 13:22:13 -08:00
Ryan Barrett ab834f586a
incoming AP Follow bug fix, reactivate if Follower exists and is inactive
thanks again @gregorLove!
2022-11-29 22:43:11 -08:00
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 559f02ad1d
AP actor handler: handle bad domain
https://console.cloud.google.com/errors/detail/CKGv-b6impW3Jg;time=P30D?project=bridgy-federated
2022-11-28 17:27:55 -08:00
Ryan Barrett d4af114247
user verification: follow multiple redirects 2022-11-28 13:10:51 -08:00
Ryan Barrett c343164f5b
user page UI redirects warning: show diff of current vs expected
for #305
2022-11-27 17:45:23 -08:00
Ryan Barrett 85b1a400ff
user page UI: first pass at details for redirect check
for #305
2022-11-27 17:33:53 -08:00
Ryan Barrett 0e7728b8c2
first pass at remote follow UI on user page
fixes #60
2022-11-27 07:20:08 -08:00
Ryan Barrett 8fddf7fb2f
if an outgoing AP activity has no actor, default to the domain user
fixes #306
2022-11-26 20:20:40 -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 b791af3ebb
outbound follows: normalize Follower.dest to AS2 actor id
for #307
2022-11-24 10:22:26 -08:00
Ryan Barrett 7fd7066a7d
AS2 request headers in tests aren't getting checked?! 2022-11-24 09:41: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 4c3ef9a230
extract out template for rendering user's addresses, add profile picture
fixes #304
2022-11-22 15:24:36 -08:00
Ryan Barrett 660682c93e
fix preferredUsername regression, it needs to be domain for Webfinger
originally added in 65f3ef3cc7. fixes #302. props to @fancypantalons for debugging!
2022-11-22 14:47:15 -08:00
Ryan Barrett 2279db46fc
start on AP followers/following collections
for #264
2022-11-21 18:47:08 -08:00
Ryan Barrett 01cb91d542
handle actor Deletes that get sent to shared inbox
...by actually deleting the corresponding Follower entities. fixes #284
2022-11-21 12:14:37 -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 b854981497
UI edits: enter web site page, /docs, flashed messages, copy Bridgy's CSS 2022-11-18 22:30:07 -08:00
Ryan Barrett f384bf5529
add User.verify(), checks redirects and home page representative h-card
for #276
2022-11-18 18:49:41 -08:00
Ryan Barrett 97ecc6df46
webmention: handle missing source URL fragment
fixes https://console.cloud.google.com/errors/detail/CKKEobWk4d2VHQ;time=P30D?project=bridgy-federated
2022-11-18 15:28:34 -08:00
Jamie Tanna 39cb90e533 Allow providing a URL fragment for posts
A number of folks use a single page for multiple posts, using a URL
Fragment parameter to denote which of the posts on the given page should
be used, and are used to this experience with Bridgy.

To allow use of this on Bridgy Fed, too, we can add support for
discovering the ID of the `h-entry` to be Webmention'd in the same way
that we do with [Bridgy].

This largely copies the structure of the existing tests, copying
`test_activitypub_follow`, and adding in multiple posts on the page.

For debugging purposes, we can make sure to log out the `fragment`.

[Bridgy]: f760c0d10e
2022-11-18 06:49:58 -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 4e0fb6536c
add timeline feeds for posts from fediverse followings
for #265
2022-11-17 12:59:09 -08:00
Ryan Barrett 023f2aa536
sharedInbox bug fix, needs to be inside endpoints mapping
for #285, https://www.w3.org/TR/activitypub/#endpoints
2022-11-17 12:59:09 -08:00
Ryan Barrett 8fd49dc882
drop non-public Create activities
fixes #289
2022-11-16 16:37:50 -08:00
Ryan Barrett 2bb76a90e7
store Activity entities for AP activities delivered to followers
for #265
2022-11-16 15:54:02 -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 46f039af63
AP: always generate an actor for every outbound activity
for #279
2022-11-15 21:43:24 -08:00
Ryan Barrett e3f1431018
noop identifier renames, key => domain or entity 2022-11-15 19:12:20 -08:00
Ryan Barrett fd5c88c713
add domain blocklist, right now primarily for Twitter 2022-11-14 22:31:45 -08:00
Ryan Barrett 881307fa0b
wm => AP, don't use Update for a Like/Announce even if we've seen it before 2022-11-14 22:31:45 -08:00
Ryan Barrett 7966650178
AP: put Public in to instead of cc to make Mastodon posts public, not unlisted
fixes #277
2022-11-13 21:46:26 -08:00
Ryan Barrett 4cc43f4c56
noop, rename resp => activity 2022-11-13 09:35:47 -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 938a4ac85c
webmention: when checking for fed.brid.gy backlink, don't require / path
fixes #278
2022-11-12 07:07:09 -08:00
Ryan Barrett 8aa11f0662
webmention => AP: store outbound followees
for #264
2022-11-11 22:50:05 -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 b24a22e817
add /responses/[DOMAIN] user pages and Response.domain property 2022-11-08 06:56:19 -08:00
Ryan Barrett 8e60346dc4
don't strip www, m, and mobile subdomains from user domains
fixes #267
2022-11-07 16:28:46 -08:00
Ryan Barrett 001cd1fe11
tried switching HTTP Sig keyId to actor URL for aaronpk, but Mastodon wouldn't verify
https://chat.indieweb.org/dev/2022-11-05#t1667687865621700
2022-11-05 15:39:05 -07:00
Ryan Barrett 2e0f6ee0be
update to handle singly valued AS2 icon and image fields
snarfed/granary@cfc5a1f743
2022-11-05 14:57:50 -07:00
Ryan Barrett 154d02d908
AP delivery bug fix: don't short circuit if a post is already sent and unchanged 2022-10-29 19:52:35 -07:00
Ryan Barrett e95f6aa9d3
minor noop comment tweaks 2022-10-08 08:18:25 -07:00
Ryan Barrett f4c71897ec
update tests to handle snarfed/granary@93a64e91a5 2022-05-27 15:56:48 -07:00
Ryan Barrett 1d36d31064
set User-Agent header globally 2022-03-24 11:18:33 -07:00
Ryan Barrett 96dba41c9b
logging: use separate loggers for each module with their names 2022-02-11 22:38:56 -08:00
Ryan Barrett 7aec2a70de
update tests to handle new User-Agent from webutil
snarfed/webutil@ccebf40ac0, snarfed/oauth-dropins#5
2022-02-09 06:52:41 -08:00
Ryan Barrett 4eaf70aa51
add 'ignored' status for AP requests where the target has no webmention endpoint 2022-01-11 22:40:44 -08:00
Ryan Barrett fdd42ad1d4
override preferredUsername to always be the user's domain
...since Mastodon looks up [preferredUsername]@fed.brid.gy. see #77
2021-10-22 21:17:45 -07:00
Ryan Barrett d23792d8b3
webmention: skip sending AP Update if content hasn't changed
fixes #78
2021-10-10 13:47:33 -07:00
Ryan Barrett c6f0c417a0
/r: handle trailing garbage chars
fixes https://console.cloud.google.com/errors/CO-fpZfMq_6ktgE
2021-09-01 19:48:37 -07:00
Ryan Barrett e4d285523f
activitypub: handle connection failures better in webmention discovery
fixes https://console.cloud.google.com/errors/CPj1-sSij7DcXQ
2021-09-01 08:19:38 -07:00
Ryan Barrett f4aefff6f4
minor noop test refactoring 2021-08-18 08:04:14 -07: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 b23705e97e
don't store a Response for OStatus/Salmon unless we actually attempt delivery 2021-07-20 15:55:16 -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 56cc66d530
flask: add common.RegexConverter
based on https://github.com/rhyselsmore/flask-reggie
2021-07-12 13:49:48 -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 c17cb3394b
flask: fix test_common, drop unused common.canonicalize_domain decorator 2021-07-10 08:53:37 -07:00
Ryan Barrett b8be570d66
flask: port activitypub 2021-07-10 08:07:40 -07:00
Ryan Barrett f26aed5cbb
flask: port salmon 2021-07-08 22:50:33 -07:00
Ryan Barrett bb5ae9910d
flask: port /wm/ 2021-07-08 07:25:44 -07:00
Ryan Barrett 5b8699bec1
flask: port /r/, start to port common 2021-07-07 21:02:13 -07:00
Ryan Barrett 0b7388fed3
flask: move app to app.py, get templates working, port /responses 2021-07-07 08:07:20 -07:00
Ryan Barrett 86a4afdc97
flask: render: get tests working 2021-07-06 20:34:35 -07:00
Ryan Barrett fa2a970b2c
flask: render: add caching, get_required_param, update tests 2021-07-06 13:45:56 -07:00
Ryan Barrett a4c5a8e4c5
redirect: handle single /s that got collapsed by the browser (etc) 2021-06-28 22:52:04 -07:00
Ryan Barrett d4a94ff75a
migrate from webmention-tools to webutil.webmention 2021-04-25 11:40:19 -07:00
Ryan Barrett 064acef4b0
verify SSL certs (more)
requires snarfed/webmention-tools@0059627cfd
2021-04-03 21:15:28 -07:00
Ryan Barrett db732650a4
add https://w3id.org/security/v1 to actors' @context for HTTP sigs
fixes #76
2021-03-22 23:55:14 -07:00
Ryan Barrett 17fa355226
webfinger: misc noop comment and test tweaks 2021-03-12 14:35:59 -08:00
Ryan Barrett f9e8a5abd2
webfinger tests: expect application/jrd+json for JRD, not application/json
for snarfed/webutil@4b277abaa4
2021-03-11 14:14:33 -08:00
Ryan Barrett f74a6d33fa
add synthetic id to outgoing AS2 activities
for #12
2021-03-10 20:37:28 -08:00
Ryan Barrett 1f977a7d5c
stop /r/ from being an open redirect by checking that we've seen the domain 2021-03-07 07:36:34 -08:00
Ryan Barrett 6b4089efe4
/r/ redirect endpoint: use HTTP 301, not 302 2021-03-06 21:47:08 -08:00
Ryan Barrett 06cd35abba
upgrade to python 3.9 runtime and feedparser 6.0.2 2021-03-06 08:03:36 -08:00
Ryan Barrett 33436a35a1
webmention: de-dupe inboxes before delivering 2021-02-24 13:41:46 -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 eef94eb033
if ActivityPub inbox delivery fails, don't fall back to Salmon 2020-11-13 09:50:14 -08:00
Ryan Barrett 155be76bca
fix outbound AP headers and signature for Mastodon 3.2.1
https://github.com/snarfed/bridgy-fed/issues/68#issuecomment-720059695
2020-11-05 12:43:27 -08:00
Ryan Barrett 8af4571648
handle django-salmon port to pycryptodome
in snarfed/django-salmon@76f31ed25c
2020-10-31 13:23:36 -07:00
Ryan Barrett dba533a14b
temporarily disable actually deleting Followers on AP Delete requests
mastodon.social sends Deletes for every Bridgy Fed account, all at basically the same time, and we have many Follower objects, so we have to do this table scan for each one, so the requests take a long time and end up spawning extra App Engine instances that we get billed for. and the Delete requests are almost never for followers we have. TODO: revisit this and do it right.
2020-10-11 08:35:14 -07:00
Ryan Barrett 2c15820ef6
webmention => AP: handle multiple in-reply-to links
fixes #65. thanks again for reporting, @nekr0z!
2020-06-06 08:40:07 -07:00
Ryan Barrett 2a91f01393
webmention: handle missing Content-Type header
for https://console.cloud.google.com/errors/CNnflKqP5rHWvgE , https://console.cloud.google.com/errors/CPyMpaulkMKWZA
2020-05-20 23:36:11 -07:00
Ryan Barrett 9eae3087fd
404 requests for root paths that aren't user domains
lots of these are fediverse tools sniffing for specific implentations, eg mastodon etc.  /siteinfo.json, /status.php, etc.
2020-03-02 10:50:43 -08:00
Ryan Barrett 9784686b1c
implement AP Delete of actors when their accounts are deleted
fixes #63
2020-02-29 20:28:53 -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 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 00d0cc5557
fully qualify relative Atom feed URLs before fetching
fixes #58. thanks again for reporting @fluffy-critter!
2019-09-23 11:20:11 -07:00
Ryan Barrett 7617d4893e
update test to match granary new whitespace handling
...again. specifically snarfed/granary@0ac54362ae
2019-09-19 11:56:29 -07:00
Ryan Barrett ef8b9b13cc
bug fix in webmention => activitypub target fetch error handling
fixes https://console.cloud.google.com/errors/CPyMpaulkMKWZA
2019-08-13 16:23:47 -07:00
Ryan Barrett 879f6d1752
return 400 on more bad inputs, eg webmention source URLs 2019-08-13 13:29:31 -07:00
Ryan Barrett 65044b081c
accept Undo of Follow even if Follower doesn't exist 2019-08-01 10:39:15 -07:00
Ryan Barrett f02c212f37
AP delivery: skip inactive followers 2019-08-01 10:36:39 -07:00
Ryan Barrett 4b70a89046
handle AP Undo of Follow
needed for eg mastodon when you unfollow and then try to refollow someone. on unfollow, mastodon sends an Undo, and waits for a 200 before it shows success and will let you refollow.
2019-08-01 10:32:50 -07:00
Ryan Barrett 6219e2d25e
update test to match granary new whitespace handling
specifically snarfed/granary@48b55441c5
2019-06-24 14:48:24 -07:00
Ryan Barrett 7c8a2a4603
fix postprocess_as2() crash on multiply-valued inReplyTo
fixes https://console.cloud.google.com/errors/COTu_PXPjJ2ZWw
2019-06-06 06:35:57 -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 90f7ac3e5b
add HTML meta redirects to mf2 rendered pages for end users
browsers will follow them, and hopefully all webmention receivers should/do ignore them, so we'll get the best progressive enhancement for both worlds.

IRC background:
https://chat.indieweb.org/dev/2019-04-11#t1555004634348000
https://chat.indieweb.org/dev/2019-04-16#t1555440757959400
2019-04-17 08:44:26 -07:00
Ryan Barrett 088e9cfaf7
skip outbound webmentions to same domain as source 2019-04-16 11:42:17 -07:00
Ryan Barrett aa45f0c526
convert AP mentions to home page webmentions
for #46
2019-04-16 10:46:40 -07:00
Ryan Barrett 5bc639216e
more error handling for AS2 objects without id or URL
follows b7e44c9295. fixes https://console.cloud.google.com/errors/CLnu14G46vHLOg
2019-04-15 08:14:37 -07:00
Ryan Barrett 6e7c2008e9
handle SSL failures when fetching arbitrary URLs
fixes https://console.cloud.google.com/errors/CJOuzd2b1sehPA
2019-04-10 08:08:02 -07:00
Ryan Barrett 2e33354c27
add following and followers fields to AS2 actors
for #40. they currently both point to endpoint URLs that don't actually work yet, just like the recently added outbox field.
2019-01-14 11:08:08 -08:00
Ryan Barrett b7e8cd7d42
add conneg + AS2 support to /r/... redirect URLs
for pixelfed, #39. specifically, if the client asks for application/activity+json or application/ld+json (which pixelfed does), fetch and convert to AS2 instead of returning a 302 redirect.
2019-01-04 12:17:50 -08:00
Ryan Barrett b237e52d6a
add outbox, summary, and publicKey.id properties to actors
for #39, for pixelfed
2019-01-04 08:05:07 -08:00
Ryan Barrett b7f89dce99
webmention => AP: handle actor/attributedTo id as well as url
for #40
2018-12-11 10:59:41 -08:00
Ryan Barrett 0af5c136bb
webmention => AP/Salmon: handle no targets or followers, return 200
fixes https://console.cloud.google.com/errors/CIrig_2B6_i87AE
2018-11-27 15:14:56 -08:00
Ryan Barrett e964190162
webmention => AP: check for link to bridgy fed in source page
fixes #42
2018-11-27 10:27:12 -08:00
Ryan Barrett a9324adceb
webmention => AP: put images into AS2 'attachment' field for Mastodon
for https://github.com/snarfed/bridgy-fed/issues/33#issuecomment-440965618
2018-11-23 22:17:37 -08:00
Ryan Barrett a88165c4e3 webmention => AP: big refactoring to support Create
#33. still in progress!
2018-11-16 07:09:55 -08:00
Ryan Barrett 2bb418dc72
webmention => AP support for u-follow-of => Follow 2018-10-24 21:28:52 -07:00
Ryan Barrett 42ad9d1998
include full AS2 actor object in Response activities
for #21
2018-10-23 13:09:49 -07:00
Ryan Barrett 98a19a994d
convert AP Follow to indieweb webmention with u-follow-of
#21, https://indieweb.org/follow
2018-10-23 11:11:50 -07:00
Ryan Barrett e090c2ba0a
AP Follow bug fix: actors are fed.brid.gy/DOMAIN, not /r/ redirect URLs 2018-10-21 18:54:27 -07:00
Ryan Barrett abc5ecd919
AP Follow: store users' followers in the datastore
#21
2018-10-21 17:37:33 -07:00
Ryan Barrett a4b309afef
activitypub: refactor Accept response to Follow activity
...and get tests working. #21
2018-10-21 15:28:42 -07:00
Ryan Barrett 9fc47c8ba9
AP => wm: switch to proxying reply wm source, unwrap URLs
for #35

example: https://webmention.io/realize.be/webmention/hG654HOgobymY54pMaNS
2018-10-17 17:49:56 -07:00
Ryan Barrett 27e56396b8
AP => wm: remove our redirect from target URLs
fixes the second half of #35
2018-10-17 12:00:38 -07:00
Ryan Barrett 9fb7f2fe26
AP => wm: prefer object URL for webmention source if available
fixes half of #35
2018-10-17 11:52:34 -07:00
Ryan Barrett 25d2724700 add Mention tag for Mastodon replies
fixes #34. thanks @swentel!
2018-10-16 11:38:12 -07:00
Ryan Barrett 2ffd10306f
AP => webmention: handle full AS2 activities
mastodon used to send bare objects for lots of things, e.g. replies, but now sends ful AS2 Create activities with embedded objects much more often. handle those too.

thanks for the nudge @swentel!
2018-10-15 11:52:11 -07:00
Ryan Barrett b25960ca93
wrap activity ids and urls and actor ids in our /r/ endpoint
for #16, #32. cc @swentel.
2018-10-14 07:58:17 -07:00
Ryan Barrett e720e543d8
add /r/ redirect endpoint
for #16, #32. cc @swentel. more to come.
2018-10-14 07:42:28 -07:00
Ryan Barrett 118f8380c7
fix tests for yet another parser change that dropped implied u-url 2018-10-11 17:16:06 -07:00
Ryan Barrett 6681a5f2c7
fix unit test failure triggered by newer versions of mf2py or BS4 or ...
problem is that explicit p-name includes `<img>` `src` value, but implicit doesn't. background in https://github.com/microformats/microformats2-parsing/issues/35 etc.

```
======================================================================
FAIL: test_activitypub_create_author_only_url (tests.test_webmention.WebmentionTest)
Mf2 author property is just a URL. We should run full authorship.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ryan/src/bridgy-fed/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "tests/test_webmention.py", line 383, in test_activitypub_create_author_only_url
    self.assert_equals(repost_as2, kwargs['json'])
  File "/Users/ryan/src/bridgy-fed/local/lib/python2.7/site-packages/oauth_dropins/webutil/testutil.py", line 182, in assert_equals
    %s""" % (msg, ''.join(e.args), expected, actual))
AssertionError: None: [actor] [name] u'Ms. \u2615 Baz' != u'Ms. \u2615 Baz  http://orig/pic'
- Ms. \u2615 Baz
+ Ms. \u2615 Baz  http://orig/pic

Expected value:
{u'@context': u'https://www.w3.org/ns/activitystreams',
 u'actor': {u'icon': ({u'type': u'Image', u'url': u'http://orig/pic'},),
            u'id': u'http://localhost/orig',
            u'image': ({u'type': u'Image', u'url': u'http://orig/pic'},),
            u'name': u'Ms. \u2615 Baz',
            u'preferredUsername': u'orig',
            u'type': u'Person',
            u'url': u'http://orig'},
 u'cc': [u'https://www.w3.org/ns/activitystreams#Public',
         u'http://orig/author',
         u'http://orig/recipient',
         u'http://orig/bystander'],
 u'id': u'http://a/repost',
 u'name': u'reposted!',
 u'object': u'tag:orig,2017:as2',
 u'type': u'Announce',
 u'url': u'http://a/repost'}
Actual value:
{u'@context': u'https://www.w3.org/ns/activitystreams',
 u'actor': {u'icon': [{u'type': u'Image', u'url': u'http://orig/pic'}],
            u'id': u'http://localhost/orig',
            u'image': [{u'type': u'Image', u'url': u'http://orig/pic'}],
            u'name': u'Ms. \u2615 Baz  http://orig/pic',
            u'preferredUsername': u'orig',
            u'type': u'Person',
            u'url': u'http://orig'},
 u'cc': [u'https://www.w3.org/ns/activitystreams#Public',
         u'http://orig/author',
         u'http://orig/recipient',
         u'http://orig/bystander'],
 u'id': u'http://a/repost',
 u'name': u'reposted!',
 u'object': u'tag:orig,2017:as2',
 u'type': u'Announce',
 u'url': u'http://a/repost'}
```
2018-10-11 16:56:55 -07:00
Ryan Barrett b8d52b3dac
move test/ => tests/ to avoid shadowing python's built in test module
fixes confusing problems with dev_appserver starting in cloud sdk 219 (app-engine-python 1.9.76). background in https://issuetracker.google.com/issues/117145272#comment25 .
2018-10-11 16:07:53 -07:00