Library to Provide a User Authentication and privilege Token Checks. It requires the Axum_Session library. This library will help by making it so User ID or authorizations are not stored on the Client side but rather on the Server side. The Authorization is linked by the Clients Serverside Session ID which is stored on the Client side. Formally known as Axum Sessions Auth
- Wraps
axum_sessionfor data management serverside. - Right Management API
- Auto load of user Data upon Page loads.
- User Data cache to Avoid Repeated Database calls when not needed.
Help
If you need help with this library or have suggestions please go to our Discord Group
Install
Sessions Authentication uses tokio runtime and ['axum_session'];
# Cargo.toml
[]
# Postgres + rustls
= { = "0.8.0", = [ "postgres-rustls" ] }
Cargo Feature Flags
default: [postgres-rustls]
advanced: Enable functions allowing more direct control over the sessions.
rest_mode: Disables Cookie Handlering In place of Header only usage for Rest API Requests and Responses.
key-store: Enabled the optional key storage. Will increase ram usage based on Fastbloom settings.
sqlite-rustls: Sqlx support for the self-contained SQLite database engine and rustls.
sqlite-native: Sqlx support for the self-contained SQLite database engine and native-tls.
postgres-rustls: Sqlx support for the Postgres database server and rustls.
postgres-native: Sqlx support for the Postgres database server and native-tls.
mysql-rustls: Sqlx support for the MySQL/MariaDB database server and rustls.
mysql-native: Sqlx support for the MySQL/MariaDB database server and native-tls.
redis-db: redis_pool 0.2.1 session support. Enables Redis Client Pool
redis-clusterdb: redis_pool 0.2.0 session support. Enabled Redis ClusterClient Pool.
surrealdb-rocksdb: 1.0.0 support for rocksdb.
surrealdb-tikv : 1.0.0 support for tikv.
surrealdb-fdb-?_? : 1.0.0 support for fdb versions 6_1, 6_2, 6_3, 7_0, 7_1. Replace ?_? with version.
surrealdb-mem : 1.0.0 support for mem.
mongo : mongodb 2.6.1 support for mongo.
Example
use ;
use SocketAddr;
use ;
use ;
use ;
async
// We can get the Method to compare with what Methods we allow. Useful if this supports multiple methods.
// When called auth is loaded in the background for you.
async
// This is only used if you want to use Token based Authentication checks
async