Skip to main content

Crate rs_auth

Crate rs_auth 

Source
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§

config
crypto
email
error
events
hooks
oauth
rate_limit
service
store
types

Structs§

AuthConfig
Top-level authentication configuration.
AuthService
Core authentication service. Generic over storage backends and email sender.
CookieConfig
HTTP cookie configuration.
EmailConfig
Email behavior configuration.
EventEmitter
LinkAccountResult
Result returned by AuthService::link_account.
LoginResult
Result returned by AuthService::login.
NoOpRateLimiter
PublicAccount
Public account record without sensitive fields like tokens.
RefreshTokenResult
Result returned by AuthService::refresh_oauth_token.
RequestResetResult
Result returned by AuthService::request_password_reset.
ResetPasswordResult
Result returned by AuthService::reset_password.
SessionResult
Result returned by AuthService::get_session.
SignupResult
Result returned by AuthService::signup.
UnlinkAccountResult
Result returned by AuthService::unlink_account.
VerifyEmailResult
Result returned by AuthService::verify_email.

Enums§

AuthError
Authentication error types.
AuthEvent
LoginFailReason
LoginMethod
OAuthIntent
Whether an OAuth flow is a login or an explicit account link.
RateLimitAction
SameSite
SameSite cookie attribute.

Traits§

AuthHook
OAuthStateStore
Storage backend for transient OAuth state records.
RateLimiter