Welp, here’s the Deno library for signing Fetch API Request objects with HTTP Signatures. Tested against Mastodon, Pleroma, and Misskey and it all works: https://gitlab.com/soapbox-pub/fedisign
@tassoman Anyone can POST /inbox from anywhere. TLS only helps verify servers, not clients.
Public activities don’t have to be signed, because if we get an unsigned activity we can just refetch it from the origin server. In that case TLS helps.
Private activities can’t be fetched, so the only way to verify it is by a key. We fetch the actor and compare their RSA public key with the HTTP Signature.
What if key-pair is lost/stolen? ?
Yes, we have to plan for that. This is what Pleroma does:
Accounts are refetched every 24 hours. A last_refreshed_at is stored on the user. So if keys are stolen, re-roll them.
Upon getting an invalid signature, refetch the actor and try one more time before giving up.
I can't get how it works ? it's a server-to-server signed request? There's already TLS between them, what's the plus? Can be signed also client-server requests? It means can work as certified mail, who can prove the message got inside the inbox of one user and got out from the outbox of another? What if key-pair is lost/stolen? ?