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 negotiation;
20pub mod rate_limit;
21pub mod security_headers;
22pub mod served_by;
23pub mod session;
24pub mod site_auth;
25pub mod trace;
26pub mod trailing_slash;
27
28pub use analytics::*;
29pub use authz::{AuthzPolicy, authz_gate};
30pub use bot_detector::*;
31pub use context::{
32    A2AContextMiddleware, ContextExtractor, McpContextMiddleware, PublicContextMiddleware,
33    UserOnlyContextMiddleware,
34};
35pub use cors::*;
36pub use ip_ban::*;
37pub use jwt::{JtiRevocationChecker, JwtContextExtractor, JwtUserContext};
38pub use negotiation::{
39    AcceptedFormat, AcceptedMediaType, content_negotiation_middleware, parse_accept_header,
40};
41pub use rate_limit::*;
42pub use security_headers::*;
43pub use served_by::*;
44pub use session::*;
45pub use site_auth::*;
46pub use trace::*;
47pub use trailing_slash::*;