Skip to main content

auth

Function auth 

Source
pub async fn auth<S: Storage + 'static, P: Provider + 'static>(
    __arg0: State<AppState<S, P>>,
    request: Request,
    next: Next,
) -> Response
Expand description

Auth middleware: validates Bearer token against configured virtual keys. Skips auth only when no admin_token is configured AND key_map is empty. Inserts Principal into request extensions for downstream handlers.