DevLog 4: IndieAuth, Webmention, and Refactor

Default banner

Published on:

The most important feature of Ownet is the IndieWeb compatibility. For this, I followed microformats2 until now. But We also need to support all other IndieWeb functionalities.

IndieAuth

IndeAuth is a specification written by Aaron Parecki, it is an extension of OAuth 2.0 Authorization Framework, my website, codingotaku.com already supports being an IndieAuth server. I took the code from there and extended it to support IndieAuth client features.

Users can register using IndieAuth, and their profile will be auto-fetched and re-used to create their account. If an email is not found, I add use domain.tld@invalid.invalid as their email for now. I should make email optional for IndieAuth users and mandatory for other users sometime later. I havenโ€™t figured out a nice approach to do it yet.

Webmentions

Just like IndieAuth, I also had support for webmentions on my website, it is another standard written by Aaron, and is being enhanced by the community. Webmentions are simply posts on another website. With the help of Microformats, it can be used to mention, respond, and interact with other websites. The only thing we need to do is that the website receiving the webmention should parse the post and figure out how to display it.

My original implementation was not complete. So this time, I extended it to have a background job that runs every 5 minutes and parses the webmention. It runs only once per new webmentions and extract necessary details from the post before displaying it.

The webmention specification tells sending the same webmention request in case the original post was deleted. I donโ€™t handle this at the moment, and ignores duplicate request. This is so that I can prevent being part of DDOS. There should be a better way to handle it, but that is for another day.

Refactor

Time for refactors, I made a few changes in the user registration logic. Now all new users will be automatically be marked as pending, and they will not be able to post or edit anything until the administrator approves them.

A banner will be displayed on top of all user editable page showing that they are in read-only mode. This is to reduce the burden on Admin to moderate all new users.

I should add a toggle to automatically accept new users, but thatโ€™s also for another day.

The rest of the refactor is just minor code improvements.


Interactions

No interactions yet.

Send a Webmention
React using webmentions Enter the URL of your post that mentions, likes, reposts, or replies to this post.