Expand description
OpenAuth authentication toolkit.
Re-exports§
pub use auth::open_auth;pub use auth::open_auth_with_adapter;pub use auth::open_auth_with_adapter_and_endpoints;pub use auth::open_auth_with_endpoints;pub use auth::OpenAuth;pub use openauth_core::oauth;
Modules§
- api
- Framework-neutral API contracts.
- auth
- Public OpenAuth initializer.
- context
- Request and runtime context contracts.
- cookies
- Cookie naming, parsing, and chunking helpers.
- crypto
- Cryptographic primitives used by OpenAuth core.
- db
- Database contracts, model metadata, and SQL naming defaults.
- env
- Environment helpers for OpenAuth core.
- error
- Error types for OpenAuth core.
- options
- Configuration types for OpenAuth core.
- plugin
- Plugin contracts for OpenAuth extensions.
- rate_
limit - Router-level rate limiting.
- session
- Database-backed session lifecycle helpers.
- user
- Database-backed user and credential account helpers.
- utils
- Small shared utilities.
- verification
- Database-backed verification token/value helpers.
Structs§
- Account
Linking Options - Account
Options - Account and OAuth account behavior.
- Advanced
Options - Advanced configuration.
- ApiError
Response - Async
Auth Endpoint - Auth
Context - Auth
Cookie - Auth
Cookies - Auth
Endpoint - Auth
Endpoint Options - Auth
Environment - Environment values used by context initialization.
- Auth
Flow Error - Auth
Plugin - Auth
Router - Body
Field - Body
Schema - Change
Email Options - Email change behavior.
- Chunked
Cookie Store - Cookie
- Cookie
Attributes Override - User-supplied cookie attribute defaults.
- Cookie
Cache Options - Session cookie cache configuration.
- Cookie
Cache Payload - Cookie
Config - Cross-subdomain cookie configuration.
- Cookie
Options - Create
Credential Account Input - Create
Session Input - Input for creating a persisted session.
- Create
User Input - Create
Verification Input - DbSession
Store - Session store backed by the OpenAuth adapter contract.
- DbUser
Store - DbVerification
Store - Delete
User Options - User deletion behavior.
- Dynamic
Rate Limit Path Rule - Email
Password Auth - Email
Password Auth Result - Email
Password Config - Email
Verification Options - Email verification configuration.
- Endpoint
Info - Endpoint
Middleware - Envelope
- Parsed Better Auth encrypted payload envelope.
- Experimental
Options - Experimental feature flags.
- GetSession
Input - GetSession
Result - Hooked
Adapter - Adapter wrapper that runs plugin database hooks for mutating operations.
- IpAddress
Options - Memory
Adapter - Async-safe in-memory adapter backed by shared state.
- OAuth2
Tokens - OAuth2
User Info - Open
ApiOperation - Open
Auth Options - Top-level OpenAuth configuration.
- Parsed
Cookie - Password
Options - Password policy configuration.
- Path
Params - Plugin
After Hook - Plugin
Async After Hook - Plugin
Before Hook - Plugin
Database Hook - Executable database hook registered by a plugin.
- Plugin
Database Hook Context - Runtime metadata passed to executable database hooks.
- Plugin
Endpoint Hooks - Plugin
Error Code - Error code contributed by a plugin.
- Plugin
Hook Matcher - Matcher used to select endpoint hooks.
- Plugin
Init Output - Typed, additive output from a plugin init handler.
- Plugin
Middleware - Plugin
Migration - Plugin migration metadata.
- Plugin
Password Validation Input - Plugin
Password Validation Rejection - Plugin
Password Validator - Plugin
Rate Limit Rule - Rate-limit rule contributed by a plugin.
- Provider
Options - Rate
Limit Options - Rate limiting defaults.
- Rate
Limit Path Rule - Rate
Limit Record - Rate limit storage record.
- Rate
Limit Rule - Secret
Config - Secret rotation configuration.
- Secret
Entry - Versioned secret entry.
- Session
Additional Field - Runtime metadata for custom session fields accepted by
/update-session. - Session
Auth - Session
Cookie Options - Session
Options - Session configuration.
- Sign
InInput - Sign
OutResult - Sign
UpInput - Social
Authorization Code Request - Social
Authorization UrlRequest - Social
IdToken Request - Telemetry
Context - Optional hints and hooks for telemetry collection.
- Telemetry
Event - Event sent to the telemetry collector or
custom_track. - Telemetry
Options - Telemetry collection settings (parity with Better Auth
telemetryinit option). - Telemetry
Publisher - Live telemetry handle (
Self::publishis a no-op when telemetry is disabled). - Telemetry
Test Hooks - Overrides used by integration tests (Vitest mocks replacement).
- Update
User Input - Update
Verification Input - User
Additional Field - Runtime metadata for custom user fields accepted by user-writing endpoints.
- User
Options - User lifecycle configuration.
- User
With Accounts - Verification
Email - Payload passed to an email verification sender.
Enums§
- ApiError
Code - Auth
Flow Error Code - Cookie
Cache Strategy - Cookie cache encoding strategy.
- Endpoint
Kind - Json
Schema Type - OAuth
Error - OAuth
State Store Strategy - Open
Auth Error - Core library error.
- Plugin
After Hook Action - Action returned by an after endpoint hook.
- Plugin
Before Hook Action - Action returned by a before endpoint hook.
- Plugin
Database After Input - Query and adapter result passed to a database hook after the operation runs.
- Plugin
Database Before Action - Action returned by a before hook.
- Plugin
Database Before Input - Query passed to a database hook before the adapter operation runs.
- Plugin
Database Operation - Mutating database operations that can be observed by plugins.
- Plugin
Request Action - Plugin
Schema Contribution - Database schema contribution made by a plugin.
- Rate
Limit Storage Option - Rate limit storage selector.
- Trusted
Origin Options
Constants§
- VERSION
- Current crate version.
Traits§
- JweSecret
Source - Secret material accepted by Better Auth-compatible JWE helpers.
- Rate
Limit Rule Provider - Rate
Limit Storage - Synchronous storage contract for router-level rate limiting.
- Send
Verification Email - Synchronous email verification sender hook.
- SocialO
Auth Provider - Trusted
Origins Provider - Request-aware trusted origin provider.
Functions§
- build_
secret_ config - Build a rotation config from validated entries.
- core_
auth_ async_ endpoints - Build Better Auth-inspired core endpoints backed by an OpenAuth database adapter.
- create_
auth_ endpoint - create_
telemetry - Creates a telemetry publisher (possibly a hard no-op when neither endpoint nor custom track exist).
- get_
telemetry_ auth_ config - parse_
request_ body - Parse a request body as JSON or
application/x-www-form-urlencoded. - parse_
secrets_ env - Parse comma-separated
version:secretentries. - symmetric_
decode_ jwt - symmetric_
decrypt - Decrypt a string with either a raw secret or a versioned secret config.
- symmetric_
encode_ jwt - symmetric_
encrypt - Encrypt a string with either a raw secret or a versioned secret config.
- validate_
secrets - Validate versioned secrets and return warnings for weak current secrets.