grantcodes / microsub-notifier

https://microsub-notifier.tpxl.io
4 stars 1 forks source link

Improve Kindle support by adding Micropub links to articles #2

Open EdwardHinkle opened 5 years ago

EdwardHinkle commented 5 years ago

An idea discussed in IRC was adding links to articles that allow a user to:

This would require a couple of things:

  1. If the user wants to enable Micropub actions, they have to "Set up Micropub via IndieAuth". When configuring the Kindle notification type, there would be a Web Sign In form allowing IndieAuth flow to retrieve a Micropub token.

  2. When a post is being sent to Kindle, it could include hyperlinks back to the microsub notifier to a url like: /actions/{JWT} The JSON Web Token would be configured on the server so you know someone isn't trying to hijack the url endpoint. The JSON Web Token would contain:

    {
    'account': 'https://eddiehinkle.com',
    'action': ('like' | 'archive' | 'bookmark'),
    'url': (post url)
    }

This allows for the server to know that the only way this request came to be is a person received the Kindle article, clicked the link which activated the URL with the JSON Web Token in it's path. This seems like enough obscurity and security to authorize the action included in the JSON Web Token to be sent to the Micropub/sub server on behalf of the account listed in the token.

grantcodes commented 5 years ago

Well I would apply this to all notification methods. And should include a microsub mark read option as well, maybe even delete.

EdwardHinkle commented 5 years ago

Ahh okay. I didn’t know if you included html with all Notifications options or not. Yeah, if you’re sending html, makes sense to include the links