khonsulabs / bonsaidb

A developer-friendly document database that grows with you, written in Rust
https://bonsaidb.io/
Apache License 2.0
1.01k stars 37 forks source link

Add Token-based Authentication #246

Closed ecton closed 2 years ago

ecton commented 2 years ago

While working on Dossier, I wanted to allow generating tokens to use in continuous integration that allow authenticating using the BonsaiDb built-in Cli interface.

This pull request looks to address the ability to assume a user or role's identity using a token created on the server.

The approach is described in the documentation on TokenChallengeAlgorithm::Blake3, and the hash computation and actual hash calls are constrained to authentication_token.rs.