axum-gate v1.0.0-rc.0 released
๐ฆ Announcing axum-gate v1.0.0-rc.0: Flexible Authentication & Authorization for Axum
Just released the first release candidate of axum-gate - a comprehensive auth solution for Rust web applications using Axum!
๐ What it does:
- Type-safe JWT authentication with cookie or bearer token support
- Hierarchical role-based access control (RBAC) with groups and permissions
- Ready-to-use login/logout handlers
- Multiple storage backends (in-memory, SurrealDB, SeaORM)
- Built-in audit logging and Prometheus metrics
๐ก Key features:
- Cookie auth for web apps, bearer tokens for APIs
- Permission system with deterministic hashing (
"domain:action"โPermissionId) - Role hierarchy with automatic supervisor inheritance
- Optional anonymous access with user context injection
- Production-ready security defaults
๐ง Quick example:
let gate = Gate::cookie("my-app", jwt_codec)
.with_policy(AccessPolicy::require_role(Role::Admin));
let app = Router::new()
.route("/protected", get(handler))
.layer(gate);
๐ฆ Crate: axum-gate on crates.io
๐ Docs: docs.rs/axum-gate
๐ง Examples: 9 complete examples covering everything from simple usage to distributed systems
Perfect for web apps needing robust auth without the complexity. Feedback and contributions welcome!