Skip to main content

Crate tower_request_guard

Crate tower_request_guard 

Source
Expand description

Request validation middleware for tower services.

tower-request-guard validates incoming requests before they reach the handler: body size limits, timeouts, content-type enforcement, required headers, and JSON depth protection.

Re-exports§

pub use guard::RequestGuard;
pub use layer::RequestGuardLayer;
pub use route::route_guard;
pub use service::RequestGuardService;
pub use violation::OnViolation;
pub use violation::Violation;
pub use violation::ViolationAction;

Modules§

body
Body size checks and bodyless-method detection.
content_type
Content-Type media type matching.
guard
Guard configuration and builder.
headers
Required header validation.
layer
Tower Layer implementation.
response
HTTP error response generation for violations.
route
Per-route override configuration via route_guard.
service
Tower Service that enforces request validation.
violation
Violation types, actions, and handling policies.