Expand description
Composable authentication for Rust.
rs-auth is a facade crate that re-exports rs_auth_core (always),
rs_auth_postgres (behind the postgres feature), and rs_auth_axum
(behind the axum feature).
§Quick start
[dependencies]
rs-auth = { version = "0.1", features = ["postgres", "axum"] }Re-exports§
pub use rs_auth_core as core;pub use rs_auth_postgres as postgres;pub use rs_auth_axum as axum;
Modules§
Structs§
- Auth
Config - Top-level authentication configuration.
- Auth
Service - Core authentication service. Generic over storage backends and email sender.
- Cookie
Config - HTTP cookie configuration.
- Email
Config - Email behavior configuration.
- Event
Emitter - Link
Account Result - Result returned by
AuthService::link_account. - Login
Result - Result returned by
AuthService::login. - NoOp
Rate Limiter - Public
Account - Public account record without sensitive fields like tokens.
- Refresh
Token Result - Result returned by
AuthService::refresh_oauth_token. - Request
Reset Result - Result returned by
AuthService::request_password_reset. - Reset
Password Result - Result returned by
AuthService::reset_password. - Session
Result - Result returned by
AuthService::get_session. - Signup
Result - Result returned by
AuthService::signup. - Unlink
Account Result - Result returned by
AuthService::unlink_account. - Verify
Email Result - Result returned by
AuthService::verify_email.
Enums§
- Auth
Error - Authentication error types.
- Auth
Event - Login
Fail Reason - Login
Method - OAuth
Intent - Whether an OAuth flow is a login or an explicit account link.
- Rate
Limit Action - Same
Site - SameSite cookie attribute.
Traits§
- Auth
Hook - OAuth
State Store - Storage backend for transient OAuth state records.
- Rate
Limiter