A lightweight and modular authentication service proof of concept (PoC) written in Rust.
- JWT-based authentication with access and refresh token support.
- Secure password hashing for user accounts.
- Role-based access control (RBAC) with support for admin and user roles.
- Revocable session management with token expiration handling.
- Middleware for CORS, rate limiting, and timeouts for production-ready APIs.
- Comprehensive configuration options for server, database, and environment settings.
-
Enter the Development Shell: Run the following command to bootstrap everything:
nix develop
This will:
- Set up all necessary Rust development tools (e.g.,
rustc
,cargo
,clippy
,rustfmt
). - Spin up an ephemeral PostgreSQL instance in Docker.
- Execute database migrations automatically using SQLx.
- Set up all necessary Rust development tools (e.g.,
-
Run the Development Server: After entering the shell, start the application:
cargo run
The server will be accessible at
http://127.0.0.1:8080
by default.
See the .env.example
file for a list of configurable environment variables.
See the API Documentation for a list of available endpoints and example requests.
This project is licensed under the MIT License. See the LICENSE file for details.