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 mcp;
61pub mod request_log;
62pub mod request_id;
63#[cfg(not(target_arch = "wasm32"))]
64pub mod otel;
65pub mod middleware;
66pub mod rate_limit;
67pub mod router;
68pub mod handler;
69pub mod schema;
70pub mod state;
71pub mod test_client;
72pub mod application;
73pub mod controller;
74pub mod language;
75#[cfg(not(target_arch = "wasm32"))]
76pub mod log;
77pub mod server;
78#[cfg(not(target_arch = "wasm32"))]
79pub mod thread_pool;
80pub mod pagination;
81pub mod rewrite;
82pub mod scheduler;
83#[cfg(not(target_arch = "wasm32"))]
84pub mod circuit_breaker;
85pub mod service_discovery;
90pub mod config_binding;
91pub mod di;
92pub mod validate;
93#[cfg(any(feature = "model-sqlite", feature = "model-postgres", feature = "model-mysql"))]
94pub mod model;
95#[cfg(not(target_arch = "wasm32"))]
96pub mod websocket;
97pub mod http_client;
101#[cfg(feature = "crypto")]
102pub mod crypto;
103#[cfg(feature = "csrf")]
104pub mod csrf;
105#[cfg(feature = "sso")]
106pub mod sso;
107#[cfg(feature = "openapi")]
108pub mod openapi;
109#[cfg(feature = "secrets")]
110pub mod secrets;
111#[cfg(not(target_arch = "wasm32"))]
114pub mod timeout;
115#[cfg(feature = "http2")]
116#[doc(hidden)]
117pub mod tls;
118#[cfg(feature = "http2")]
119#[doc(hidden)]
120pub mod h2_server;
121#[cfg(feature = "http3")]
122#[doc(hidden)]
123pub mod h3_handler;
124
125#[cfg(any(feature = "storage-local", feature = "storage-s3", feature = "storage-azure", feature = "storage-gcs", feature = "secrets"))]
128pub mod storage;
129
130#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
134pub fn crypto_provider() -> rustls::crypto::CryptoProvider {
135 #[cfg(feature = "fips")]
136 return rustls::crypto::default_fips_provider();
137 #[cfg(not(feature = "fips"))]
138 rustls::crypto::aws_lc_rs::default_provider()
139}
140
141pub const FIPS: bool = cfg!(feature = "fips");
143
144#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
151#[doc(hidden)]
152pub fn tls_client_builder() -> rustls::ConfigBuilder<rustls::ClientConfig, rustls::WantsVerifier> {
153 rustls::ClientConfig::builder_with_provider(std::sync::Arc::new(crate::crypto_provider()))
154 .with_safe_default_protocol_versions()
155 .expect("aws-lc-rs supports rustls's default protocol versions")
156}
157
158
159#[cfg(test)]
160pub(crate) mod test_env;
161
162#[cfg(feature = "macros")]
166#[doc(hidden)]
167pub use rws_macros::{Config, FromPath, FromRequest, JsonSchema, Validate};