//! Middleware for AT-Jet
//!
//! Provides common middleware for HTTP APIs.
//!
//! # Available Middleware
//!
//! - [`BasicAuthLayer`] - HTTP Basic Authentication (username/password)
//! - [`AuthLayer`] - Generic authentication (placeholder for custom impl)
//! - [`RequestLoggingLayer`] - Request/response logging
//! - [`TimeoutLayer`] - Request timeout
//!
//! # Example: Basic Auth
//!
//! ```rust,ignore
//! use at_jet::middleware::BasicAuthLayer;
//!
//! let app = Router::new()
//!     .route("/admin", get(admin_handler))
//!     .route("/health", get(health_handler))
//!     .layer(BasicAuthLayer::new("admin", "secret")
//!         .realm("Admin Area")
//!         .exclude("/health"));
//! ```

pub mod auth;
pub mod basic_auth;
#[cfg(feature = "metrics")]
pub mod http_metrics;
#[cfg(feature = "jwt")]
pub mod jwt_auth;
pub mod logging;
pub mod request_id;
pub mod timeout;
pub mod tracing_span;

pub use {auth::AuthLayer,
         basic_auth::{BasicAuthConfig,
                      BasicAuthLayer,
                      BasicAuthMiddleware,
                      basic_auth_middleware},
         logging::RequestLoggingLayer,
         request_id::{RequestId,
                      RequestIdLayer,
                      X_REQUEST_ID},
         timeout::TimeoutLayer,
         tracing_span::{SmartSpanMaker,
                        smart_trace_layer}};

#[cfg(feature = "metrics")]
pub use http_metrics::HttpMetricsLayer;

#[cfg(feature = "jwt")]
pub use jwt_auth::{Claims,
                   JwtAuthError,
                   JwtAuthLayer,
                   JwtConfig,
                   JwtValidator};
