Skip to main content

Module middleware

Module middleware 

Source
Expand description

HTTP middleware components for the Kosh server.

This module exposes two middleware functions that wrap the protected route layer:

  • auth_guard: Validates the session token on every incoming request before passing it to the handler.
  • log_middleware: Runs after the handler completes and collects error telemetry from the response extensions for dispatch to the logging service.

Functionsยง

auth_guard
Middleware that guards protected routes by validating the session token.
log_middleware
Middleware for post-request error telemetry.