Expand description
axum application factory + shared state + signed-request middleware.
Structs§
- AppState
- Application state shared by every route. The single SQLite connection
is wrapped in a
Mutexsince rusqlite is sync-only; handlers acquire the lock briefly. For long-running queries we’dspawn_blocking, but the workload here is microsecond-scale. - Signed
Session - Carries the verified
auth::Sessioninto the route handler viaExtension<SignedSession>.
Functions§
- build_
state - Wrap a
Connectionin shared state and apply schema bootstrap + the server task-signing key initialisation. - build_
state_ in_ memory - create_
app - Build the axum
Routerwith every route and middleware wired up. - signed_
request - Middleware factory that:
- username_
for - Resolve
user_id -> usernamefor audit log actor strings.