1#![cfg_attr(docsrs, feature(doc_cfg))]
11
12#[cfg(test)]
15extern crate self as rust_web_server;
16
17#[allow(unused_imports)]
20#[doc(hidden)]
21pub use rws_base::{core, dns, ext, http, mime_type, null, symbol, url};
22#[allow(unused_imports)]
24#[doc(hidden)]
25pub use rws_http::{app_manifest, body, client_hint, compression, cors, entry_point, error, extract, header, json, range, request, response, server_config, virtual_host};
26
27pub mod app;
28#[cfg(feature = "auth")]
29pub mod auth;
30#[cfg(feature = "http2")]
31pub mod async_state;
32#[cfg(feature = "http2")]
33#[doc(hidden)]
34pub mod async_bridge;
35pub mod session;
36#[cfg(not(target_arch = "wasm32"))]
39#[doc(hidden)]
40pub mod redis_protocol;
41pub mod sse;
42pub mod cookie;
43#[cfg(all(unix, any(feature = "http1", feature = "http2")))]
44pub mod systemd;
45pub mod ip_filter;
46pub mod blocklist;
47pub mod cache;
48pub mod early_hints;
49pub mod disk_guard;
50pub mod authz;
51pub mod config_reload;
52#[cfg(not(target_arch = "wasm32"))]
53pub mod config_watch;
54#[cfg(any(feature = "auth-asymmetric", feature = "sso"))]
56pub mod rsa_key;
57pub mod feature;
58pub mod maintenance;
59pub mod metrics;
60pub mod health;
61pub mod mcp;
62pub mod request_log;
63pub mod request_id;
64#[cfg(not(target_arch = "wasm32"))]
65pub mod otel;
66pub mod middleware;
67pub mod rate_limit;
68pub mod router;
69pub mod group;
70pub mod flash;
71#[cfg(feature = "serde")]
72pub mod vite;
73#[cfg(not(target_arch = "wasm32"))]
75pub mod channels;
76pub mod events;
77pub mod error_pages;
78pub mod handler;
79pub mod schema;
80pub mod state;
81pub mod test_client;
82pub mod application;
83pub mod controller;
84pub mod language;
85#[cfg(not(target_arch = "wasm32"))]
86pub mod log;
87pub mod server;
88#[cfg(not(target_arch = "wasm32"))]
89pub mod thread_pool;
90pub mod pagination;
91pub mod rewrite;
92pub mod scheduler;
93#[cfg(not(target_arch = "wasm32"))]
94pub mod circuit_breaker;
95pub mod service_discovery;
100pub mod config_binding;
101pub mod di;
102pub mod validate;
103#[cfg(any(feature = "model-sqlite", feature = "model-postgres", feature = "model-mysql"))]
104pub mod model;
105#[cfg(not(target_arch = "wasm32"))]
106pub mod websocket;
107pub mod http_client;
111#[cfg(feature = "crypto")]
112pub mod crypto;
113#[cfg(feature = "csrf")]
114pub mod csrf;
115#[cfg(feature = "sso")]
116pub mod sso;
117#[cfg(feature = "openapi")]
118pub mod openapi;
119#[cfg(feature = "secrets")]
120pub mod secrets;
121#[cfg(not(target_arch = "wasm32"))]
124pub mod timeout;
125#[cfg(feature = "http2")]
126#[doc(hidden)]
127pub mod tls;
128#[cfg(feature = "http2")]
129#[doc(hidden)]
130pub mod h2_server;
131#[cfg(feature = "http3")]
132#[doc(hidden)]
133pub mod h3_handler;
134
135#[cfg(any(feature = "storage-local", feature = "storage-s3", feature = "storage-azure", feature = "storage-gcs", feature = "secrets"))]
138pub mod storage;
139
140#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
144pub fn crypto_provider() -> rustls::crypto::CryptoProvider {
145 #[cfg(feature = "fips")]
146 return rustls::crypto::default_fips_provider();
147 #[cfg(not(feature = "fips"))]
148 rustls::crypto::aws_lc_rs::default_provider()
149}
150
151pub const FIPS: bool = cfg!(feature = "fips");
153
154#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
161#[doc(hidden)]
162pub fn tls_client_builder() -> rustls::ConfigBuilder<rustls::ClientConfig, rustls::WantsVerifier> {
163 rustls::ClientConfig::builder_with_provider(std::sync::Arc::new(crate::crypto_provider()))
164 .with_safe_default_protocol_versions()
165 .expect("aws-lc-rs supports rustls's default protocol versions")
166}
167
168
169#[cfg(test)]
170pub(crate) mod test_env;
171
172#[cfg(feature = "macros")]
176#[doc(hidden)]
177pub use rws_macros::{Config, FromPath, FromRequest, JsonSchema, Validate};