Side-quest: An Elixir atproto OAuth library

aka bikeshedding for great good


I took a break from working on annot.at to break out the atproto OAuth implementation into its own library. It has taken me longer than I expected, mostly because a lot of my assumptions around atproto OAuth and what an Elixir library for it would look like were wrong or naive.

The biggest difficulty I bumped into was DPoP nonce handling. The fact that you need to sign the access token for each request, although I'm sure a huge security improvement, adds a lot of complexity to an atproto library. Especially one written in a functional programming language. Elixir is not as "pure" as something like Haskell, you do have escape hatches like ETS, but it still expects you to be pretty explicit with stuff like shared mutable state.

So why did I write my own implementation and not use an existing library like atex? Mostly to learn, I wanted to understand how the different pieces fit together. Personally I struggle to engage with specs and documentation by just reading, I need to actually write some code for it all to click. But also because atex runs its own application supervisor and I wanted to see if I could put my money where my mouth is and make a version that follows the Elixir library style guide.

It's not quite ready for release yet, but you can follow along at https://tangled.org/jola.dev/latch.


Log in to leave a note.