Skip to main content

systemprompt_api/services/middleware/
mod.rs

1//! HTTP middleware layers for the API server.
2//!
3//! Collects the request-pipeline concerns mounted by the router: client-address
4//! resolution, CORS and security headers, bot detection and IP banning, rate
5//! limiting, JWT and session context establishment, request-context flavours,
6//! content negotiation, authorization gating, analytics, and tracing.
7//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11pub mod analytics;
12pub mod authz;
13pub mod bot_detector;
14pub mod client_addr;
15pub mod context;
16pub mod cors;
17pub mod ip_ban;
18pub mod jwt;
19pub mod load_shed;
20pub mod negotiation;
21pub mod rate_limit;
22pub mod security_headers;
23pub mod served_by;
24pub mod session;
25pub mod site_auth;
26pub mod trace;
27pub mod trailing_slash;
28
29pub use analytics::*;
30pub use authz::{AuthzPolicy, authz_gate};
31pub use bot_detector::*;
32pub use context::{
33    A2AContextMiddleware, ContextExtractor, McpContextMiddleware, PublicContextMiddleware,
34    UserOnlyContextMiddleware,
35};
36pub use cors::*;
37pub use ip_ban::*;
38pub use jwt::{JtiRevocationChecker, JwtContextExtractor, JwtUserContext};
39pub use load_shed::LoadShed;
40pub use negotiation::{
41    AcceptedFormat, AcceptedMediaType, content_negotiation_middleware, parse_accept_header,
42};
43pub use rate_limit::*;
44pub use security_headers::*;
45pub use served_by::*;
46pub use session::*;
47pub use site_auth::*;
48pub use trace::*;
49pub use trailing_slash::*;