Expand description
Http Layer
s provided by Rama.
A Layer
, as defined in crate::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§
- Authorization related middleware.
- Apply a limit to the request body.
- Convert panics into responses.
- Tools for classifying responses as either success or failure.
- Middleware that compresses response bodies.
- Middleware which adds headers for CORS.
- Middleware that decompresses request and response bodies.
- Middleware for following redirections.
- Extract a header config from a request or response and insert it into the
Extensions
of itsContext
. - Apply a transformation to the request body.
- Apply a transformation to the response body.
- Middleware that normalizes paths.
- Http OpenTelemetry
Layer
Support for Rama. - Propagate a header from the request to the response.
- Middleware that validates if a request has the appropriate Proxy Authorisation.
- Set and propagate request ids.
- Middleware for retrying “failed” requests.
- Middlewares that mark headers as sensitive.
- Middleware for setting headers on requests and responses.
- Middleware to override status codes.
- Middleware that applies a timeout to requests.
- middleware to handle branching into http upgrade services
- Middleware that validates requests.