Problem/Motivation
I run an Akkoma instance (Pleroma fork). I have "Authorized Fetch Mode" enabled on it, which requires HTTP signatures on AP fetches.
When doing a little testing between Drupal and my Akkoma, I got this error logged on the Drupal end:
Signature verifying exception: Client error: `GET https://mycrowd.ca/users/fluglbrrzzkj3332lz` resulted in a `401 Unauthorized` response: Request not signed
(mycrowd.ca is the Akkoma instance)
Steps to reproduce
I was trying to follow the Drupal user from a test account on the Akkoma instance.
I have the feeling that with Authorized Fetch on, this may not work presently.
The context plugin suffers from this problem, but also fetching simply author information.
More background: https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/#t...
swentel: Got it myself as well trying to follow https://reentry.codl.fr/users/apod
Patch for AP library: https://github.com/landrok/activitypub/issues/49
Remaining tasks
Add an 'instance' actor with public/private keys so we can sign those requests.
More info:
https://hub.sunny.garden/2023/06/28/what-does-authorized_fetch-actually-do/
https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/ (The Instance Actor)
Issue fork activitypub-3420731
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
swentel commentedIt doesn't ring a bell, so yes, we might miss something here, although I have no idea what this Authorized Fetch Mode means exactly.
Is there any documentation about this somewhere that you know of? I hope we're able to use the Nodeinfo of the pleroma instance to figure out that also GET requests to a user to fetch the AP information needs to be signed (hopefully also just like we're already signing outbox requests).
Comment #3
kinetix242 commentedSome info on it: https://hub.sunny.garden/2023/06/28/what-does-authorized_fetch-actually-do/
I am curious if my Activitypub settings could cause the problem - I have the site-wide user set to 0, which I might have accidentally done, but I haven't seen information / documentation on what the value should be.
Comment #4
kinetix242 commentedI'll just add that I've created a separate user for Activitypub, changed the site-wide user to that user ID (5), and ensured that authenticated users can publish to the site-wide actor.
Same result when trying to do the follow from the Akkoma instance.
I hope my additional comments are somewhat helpful. Please let me know if there's more I can do.
Comment #5
swentel commentedOk, that post is good enough to dive into it as it has links to issues/code/documentation so I can figure out.
As far as I can see, this isn't necessarily part of the ActivityPub protocol, but I guess it can't hurt to enable this.
Comment #6
kinetix242 commentedI don't know if this will be at all helpful about the topic, but it looks like there's a draft report for "ActivityPub and HTTP Signatures" at https://swicg.github.io/activitypub-http-signature/#survey-of-standards-...
I apologise for the noise if this isn't helpful.
Comment #7
swentel commentedLooking at this, this is also a problem for simply getting the actor information to get the avatar.
Comment #8
mradcliffeI pretty much have to double-knock or triple-knock all requests now.
1st - unsigned for GET
2nd - signed via RFC 9421
3rd - signed via cavage-12 draft
Basically my solution is to try/catch and recursively call with a different signature option, and depending on the implementation, a different response code is returned when a signature is needed (or an instance doesn't support a signature implementation). These are 401, 403, and 406. wafrn, until recently, returned a 200 with text/html representation of the document, if a signature was required for the actor, but I recently fixed this for them.
Comment #9
swentel commentedComment #10
swentel commentedComment #11
swentel commentedComment #12
swentel commentedComment #13
swentel commentedComment #15
swentel commentedComment #17
swentel commentedYes! Coming in the next release, actor and status requests are now signed with the 'instance' actor which is now available. When installing, or upgrading, you will need to generate keys for this special 'instance' actor at 'admin/config/services/activitypub'. I can finally follow users on instance which have this 'feature' turned on!