RustFrameworksAxum
Axum
End-to-end authentication and authorization patterns for Rust services using Axum and wacht.
Use this section when your Rust service is built on Axum and you want Wacht auth enforced at middleware and handler levels.
What this section covers
Required dependencies
[dependencies]
wacht = { version = "0.1.0-beta.4", features = ["axum"] }
axum = "0.8"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }The axum feature is enabled by default in wacht, but keeping it explicit in Cargo.toml makes integration intent clear.
Integration model
- Add
AuthLayerto protected route trees. - Use typed extractors (
RequireAuth,OptionalAuth,RequirePermission<T>) in handlers. - For API key or OAuth access-token gateways, call the gateway API from handlers or service layer.
For backend management endpoints (users, orgs, webhooks, settings), continue with Rust Backend Overview.