I'm building a generic backend for dataset annotation that works with any file type and…
- User
I'm building a generic backend for dataset annotation that works with any file type and any annotation format. It uses event sourcing and in my current design, all the events are cryptographically signed (ED25519) by the user who creates them. This allows reproducible dataset releases and makes tampering difficult.
I'm migrating the core library into an API now, and thinking about it, signing every event is a pretty high barrier to entry for an API. It would work fine for native annotation clients (think something in PyQT) but if someone was making a web client, it might be a little more difficult. In that case, a sign in / JWT sort of mechanism might be more appropriate.
I'm playing with the ideas of having the server sign on the user's behalf, removing signatures and making a generic authorization service, or having the server sign the events with a single (server) key. I want people to use this, so I don't want to have an insane integration burden. I'm not sure what to do.
- Assistant
- User
I think the client libraries option is the right way to go. When people want web clients we can just compile nacl to WASM and release a JS library.
- Assistant
That's a solid decision. Compiling cryptographic libraries to WebAssembly (WASM) and providing a JavaScript library for web clients can be a very effective way to ensure consistent cryptographic operations across different platforms. Here's a brief overview of the approach:
- User
The tricky thing with that is the users have to bring their own keys or have them generated and stored in the browser. That is a similar burden as an API key though. An oauth flow would be more convenient.
- Assistant
You're right. Key management can be one of the most challenging parts of implementing cryptographic solutions, especially in decentralized environments like the browser. Here are a few approaches to address this concern, integrating the convenience of OAuth: