Expand description
Test helpers and in-memory fakes for auth integration tests.
Re-exports§
pub use crate::jwt::JwtStrategy as TestJwtStrategy;pub use crate::session::SessionStrategy as TestSessionStrategy;
Structs§
- Auth
Test Guard - Holds the auth test lock for the duration of a test (serialises global auth state).
- Test
Response - The status + body captured from a test request.
- Test
User - Simple in-memory user for auth tests.
Functions§
- create_
test_ user - Create a user in the in-memory store.
- hash_
test_ password - Hash a password at the low test cost.
- init_
test_ auth - Initialise in-memory auth state for tests.
- jwt_
for_ user - Issue a signed JWT access token for a test user id.
- reset_
store - Reset the in-memory user store between tests.
- send
- Send a request to
routerin-process and capture the response. - send_
with_ headers - Send a request with extra headers.
- session_
for_ user - Sign a user into a fresh session (helper for session strategy tests).
- test_
auth_ config - Build a default auth config for tests (cookie strategy only).
- test_
jwt_ auth_ config - Build auth config with JWT enabled.