Skip to main content

rama_http/layer/
mod.rs

1//! Http [`Layer`]s provided by Rama.
2//!
3//! A [`Layer`], as defined in [`rama_core::Service`],
4//! is a middleware that can modify the request and/or response of a [`Service`]s.
5//! It is also capable of branching between two or more [`Service`]s.
6//!
7//! Examples:
8//! - [`auth`]: A layer that can be used to authenticate requests, branching
9//!   in case the request is not authenticated (read: rejected).
10//! - [`cors`]: A layer that can be used to add CORS headers to the response.
11//!
12//! Most layers are implemented as a [`Service`], and then wrapped in a [`Layer`].
13//! This is done to allow the layer to be used as a service, and to allow it to be
14//! composed with other layers.
15//!
16//! [`Layer`]: rama_core::Layer
17//! [`Service`]: rama_core::Service
18
19pub mod auth;
20pub mod body_capture;
21pub mod body_limit;
22pub mod catch_panic;
23pub mod classify;
24pub mod collect_body;
25pub mod cors;
26pub mod csrf;
27pub mod dns;
28pub mod dpi_proxy_credential;
29pub mod error_handling;
30pub mod follow_redirect;
31pub mod forwarded;
32pub mod har;
33pub mod header_config;
34pub mod header_from_str_config;
35pub mod header_option_value;
36pub mod into_response;
37pub mod map_request_body;
38pub mod map_response_body;
39pub mod match_redirect;
40pub mod normalize_path;
41pub mod propagate_headers;
42pub mod proxy_auth;
43pub mod remove_header;
44pub mod request_id;
45pub mod required_header;
46pub mod retry;
47pub mod rewrite_uri;
48pub mod sensitive_headers;
49pub mod set_header;
50pub mod set_status;
51pub mod timeout;
52pub mod trace;
53pub mod traffic_writer;
54pub mod upgrade;
55pub mod uri;
56pub mod validate_request;
57pub mod version_adapter;
58
59#[cfg(feature = "html")]
60#[cfg_attr(docsrs, doc(cfg(feature = "html")))]
61pub mod html_rewrite;
62
63pub mod json_capture;
64pub mod json_rewrite;
65
66#[cfg(feature = "opentelemetry")]
67#[cfg_attr(docsrs, doc(cfg(feature = "opentelemetry")))]
68pub mod opentelemetry;
69
70pub(crate) mod util;
71
72#[cfg(feature = "compression")]
73#[cfg_attr(docsrs, doc(cfg(feature = "compression")))]
74pub mod compression;
75#[cfg(feature = "compression")]
76#[cfg_attr(docsrs, doc(cfg(feature = "compression")))]
77pub mod decompression;