Expand description
Http Layer
s provided by Rama.
A Layer
, as defined in rama_core::Service
,
is a middleware that can modify the request and/or response of a Service
s.
It is also capable of branching between two or more Service
s.
Examples:
auth
: A layer that can be used to authenticate requests, branching in case the request is not authenticated (read: rejected).cors
: A layer that can be used to add CORS headers to the response.
Most layers are implemented as a Service
, and then wrapped in a Layer
.
This is done to allow the layer to be used as a service, and to allow it to be
composed with other layers.
Modules§
- auth
- Authorization related middleware.
- body_
limit - Apply a limit to the request body.
- catch_
panic - Convert panics into responses.
- classify
- Tools for classifying responses as either success or failure.
- collect_
body - Collect the http
Body
- compression
compression
- Middleware that compresses response bodies.
- cors
- Middleware which adds headers for CORS.
- decompression
compression
- Middleware that decompresses request and response bodies.
- dns
- Layers in function of DNS.
- error_
handling - Middleware to turn
Service
errors intoResponse
s. - follow_
redirect - Middleware for following redirections.
- forwarded
- Middleware to support the reading and writing of Forwarded headers.
- header_
config - Extract a header config from a request or response and insert it into the
Extensions
of itsContext
. - header_
option_ value - Similar to
super::header_config::HeaderConfigLayer
, but storing theDefault
value of typeT
in case the header with the givenHeaderName
is present and has a bool-like value. - map_
request_ body - Apply a transformation to the request body.
- map_
response_ body - Apply a transformation to the response body.
- normalize_
path - Middleware that normalizes paths.
- opentelemetry
telemetry
- Http OpenTelemetry
Layer
Support for Rama. - propagate_
headers - Propagate a header from the request to the response.
- proxy_
auth - Middleware that validates if a request has the appropriate Proxy Authorisation.
- remove_
header - Middleware for removing headers from requests and responses.
- request_
id - Set and propagate request ids.
- required_
header - Middleware for setting required headers on requests and responses, if they are missing.
- retry
- Middleware for retrying “failed” requests.
- sensitive_
headers - Middlewares that mark headers as sensitive.
- set_
header - Middleware for setting headers on requests and responses.
- set_
status - Middleware to override status codes.
- timeout
- Middleware that applies a timeout to requests.
- trace
- Middleware that adds high level tracing to a
Service
. - traffic_
writer - Middleware to write Http traffic in std format.
- ua
- User-Agent (see also
rama-ua
) http layer support - validate_
request - Middleware that validates requests.