Expand description
Test authentication builder and utilities. Test authentication utilities.
Provides a builder-based API for setting up authentication state in tests,
replacing the deprecated force_authenticate method.
§Architecture
ForceLoginUser: Trait for extracting session identity from any user type. Blanket-implemented for allAuthIdentitytypes (available on native targets).SessionIdentity: Type-erased identity struct matchingCookieSessionAuthMiddlewarefields.AuthBuilder: Entry point returned byAPIClient::auth().SecondaryAuth: Open trait for secondary auth layers (MFA, PassKey, etc.).
§Platform Support
Session/JWT builders, TOTP secondary auth, and AuthIdentity blanket impl are
available unconditionally on native targets (non-wasm).
Structs§
- Auth
Builder - Entry point for building auth configurations on an
APIClient. - JwtAuth
Builder - Builder for JWT test authentication.
- JwtTest
Config - JWT configuration for test contexts.
- Server
FnAuth Builder - Builder for auth configuration in server_fn test contexts.
- Session
Auth Builder - Builder for session-based test authentication.
- Session
Identity - Type-erased session identity, decoupled from the user’s concrete type.
- Totp
Secondary Auth - TOTP MFA secondary authentication for tests.
Enums§
- Test
Auth Error - Errors that can occur during test authentication setup.
Traits§
- Force
Login User - Trait for extracting session-storable identity from any user type.
- Secondary
Auth - Secondary (multi-factor) authentication layer.