Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication layer for the koan server.

When auth_enabled = true:

  • All GraphQL/Subsonic requests must carry a valid JWT in Authorization: Bearer <token>
  • Auth routes (/auth/login, /auth/refresh, /auth/logout) are always accessible

When auth_enabled = false (opt-in, not the default):

  • All requests are treated as admin — no auth required. Same behavior as before this feature.

Modules§

middleware
Axum middleware for JWT authentication.
password
Username and password checks for transports that send them with every request, such as Subsonic’s p=.
routes
Auth HTTP routes: login, refresh, logout.

Structs§

AuthUser
Authenticated user context injected into request extensions and GraphQL context.