Skip to main content

Module middleware

Module middleware 

Source

Functions§

auth_when_required
Middleware that rejects requests without a login of one of the accepted methods when settings.registry.auth_required is true.
errors_as_json
Turns error responses that are not JSON yet, like the rejections of axum’s extractors, into the error format of all Kellnr endpoints. Their text becomes the detail; other headers are kept. A PlainTextError stays as it is.