Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication layer for the koan server.

When auth_enabled = true:

  • GraphQL requests must carry a valid JWT (see middleware for where it is read from); the web UI takes it only as the koan_access cookie
  • 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.

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.