Passtoken is a lightweight authentication system that allows you to:
- Separate your authentication database from the rest of your data
- Be sure it wont crash on you (because its written in rust)
- Run it standalone or embed it into any Rust, C, Python (WIP) or Javascript/Typescript (WIP) project, or anywhere you can run Web Assembly (WIP)
Passtoken can be run standalone or embeded into other projects.
- cargo and rustc
- postgres database
- redis database
- Rename
core/.env.example
to.env
and setDATABASE_URL
to the url to your postgres database. - Run
cargo build --release -p server
to build a release binary. - The final binary will be located at
target/release/passtoken._
The file extension will be different depending on what operating system you build for. - When running the binary, make sure to copy
.env.example
as.env
and edit the file to setREDIS_URL
as the url to your redis database, andPOSTGRES_URL
as the url to your postgres database, and optionally setTOKEN_EXPIRE_TIME
as how long in seconds you want tokens to last after being used.
For embeding into rust, it is as simple as including the library in your projects Cargo.toml
To build the C/C++ bindings, compile the c_bindings
project with cargo build --release -p c_bindings
The headers will be in the include
directory, and the library file will be in target/release/libc_bindings._
The file extension will be different depending on what operating system you build for.
WIP
WIP
WIP