Day 30: private webmentions (special valentines edition)
Now that I support both private posts and webmention, it is time to put those two together and send private webmentions. In short, this is a way to notify URLs you mention in your posts, while still maintaining the privacy of the post.
Following the description on Indieweb.org, my private posts now send a HTTP Link header to my new token endpoint. When I send a private mention, I also send a code: a JWT token with the
source URLs of the webmention and an expiration of 2 minutes. The other side can discover my token endpoint by looking at the Link header, and send the code in a POST request.
The code is then exchanged for an access token, but now with a
me, which is set to the URL of the mentioned post, a
page, which is my page, and a
nonce to mess things up a little. This access token expires in an hour, which is plenty for automated fetching, but might be a bit short for people verifying manual. Normal people can still try and login via IndieAuth though!
However, the mentioned URLs and the whitelisted people are different fields, so they can be different. In fact, they should different: if I mention
someone.com/a-post, I might to give
someone.com access to the post by logging in, but only if the owner of
someone.com/a-post is actually
someone.com. In case of
twitter.com/url-to-tweet, I don’t want to give
twitter.com access. I’m not sure how to solve this yet, so I will do it manual until it hurts.
Also note that I only implemented sending private webmentions today. Please don’t private-mention me now. I will do that part tomorrow.
Now for the Special Valentines Edition™: I just created a post with a
u-like-of pointing to a personal site / profile of someone I like. The post is of course private and only I and that person can see it when we log in. I have sent a private webmention for it. The only sad thing is that the other side did not support private webmention and nothing got sent, so I guess it does not really count as my first private mention. Tragic Valentines Day for me so far.