Renew HTTP signatures when following redirects #973
No reviewers
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma!973
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Oneric/akkoma:httpsig_redirect_resign"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finally fixing our side of #731
This means we can now fetch posts from e.g. Mastodon and PeerTube’s remote post display links (since they redirect to the original) even if the actual author’s instance requires authorized fetch.
Unfortunately most other implementations remain buggy afaik, so we have to keep the awful "route alias" handling in our own verification logic for now (though, with lazy route-alias evaluation this is at least no longer as costly as it used to be)
Initial checks and
mix testseem good, but let’s have it spend some time in prod testing before merge to be sure; more testers welcome thoughccbf5ff204e116558dcfe116558dcfe8d217f3c7this seems fine, could do with an extra test for the condition though methinks
@ -414,1 +380,3 @@|> sign_fetch(id, date)http_opts =if Pleroma.Config.get([:activitypub, :sign_object_fetches]) dopart of me wonders why we even have this option
If we drop it a bunch of tests fail since they only mocked requests with only a
content-typeheader and nothing more. I suspect this and lack of motivation to fix the mocks is the main reason for this and the (actually limited to:testonly) option to not set the user-agent header existinge8d217f3c78066db8e0cif you mean the
Pleroma.Config.get([:activitypub, :sign_object_fetches])check, there’s already a test for it (and it’s updated in the diff)As for the actual signature logic, I’m pretty confident it works well without unwatend drawbacks now.
But turns out
HTTPwas being sloppy and mixed and duplicated all Tesla options into adapter options so the key redaction for logs didn’t actually work. (It only redacted the top-level copy not the copy in adapter options).To (probably) fix this I had to force adapter options into a subkey and go through all uses of
Pleroma.HTTPfunctions. In the process I noticed a bunch of obsolete unused or unneeded modules and deleted them. This makes this quite a bigger change — but also a net removal of ~260 lines of codes8066db8e0ca5b727ef81a5b727ef81b9f79f333fsign_object_fetchesandsend_user_agentconfig options #983