Module basic_auth

Module basic_auth 

Source
Expand description

Basic HTTP Authentication middleware

Provides a simple username/password authentication layer for protecting admin endpoints.

§Example

use at_jet::middleware::BasicAuthLayer;

let app = Router::new()
    .route("/admin", get(admin_handler))
    .route("/health", get(health_handler))
    .layer(BasicAuthLayer::new("admin", "secret").exclude("/health"));

Structs§

BasicAuthConfig
Basic Authentication configuration
BasicAuthLayer
Basic Authentication Layer
BasicAuthMiddleware
Basic Authentication middleware service

Functions§

basic_auth_middleware
Middleware function for use with axum::middleware::from_fn_with_state