pub struct MiddlewareSpec {Show 25 fields
pub add_prefix: Option<MiddlewareAddPrefix>,
pub basic_auth: Option<MiddlewareBasicAuth>,
pub buffering: Option<MiddlewareBuffering>,
pub chain: Option<MiddlewareChain>,
pub circuit_breaker: Option<MiddlewareCircuitBreaker>,
pub compress: Option<MiddlewareCompress>,
pub content_type: Option<MiddlewareContentType>,
pub digest_auth: Option<MiddlewareDigestAuth>,
pub errors: Option<MiddlewareErrors>,
pub forward_auth: Option<MiddlewareForwardAuth>,
pub grpc_web: Option<MiddlewareGrpcWeb>,
pub headers: Option<MiddlewareHeaders>,
pub in_flight_req: Option<MiddlewareInFlightReq>,
pub ip_allow_list: Option<MiddlewareIpAllowList>,
pub ip_white_list: Option<MiddlewareIpWhiteList>,
pub pass_tls_client_cert: Option<MiddlewarePassTlsClientCert>,
pub plugin: Option<BTreeMap<String, Value>>,
pub rate_limit: Option<MiddlewareRateLimit>,
pub redirect_regex: Option<MiddlewareRedirectRegex>,
pub redirect_scheme: Option<MiddlewareRedirectScheme>,
pub replace_path: Option<MiddlewareReplacePath>,
pub replace_path_regex: Option<MiddlewareReplacePathRegex>,
pub retry: Option<MiddlewareRetry>,
pub strip_prefix: Option<MiddlewareStripPrefix>,
pub strip_prefix_regex: Option<MiddlewareStripPrefixRegex>,
}
Expand description
MiddlewareSpec defines the desired state of a Middleware.
Fields§
§add_prefix: Option<MiddlewareAddPrefix>
AddPrefix holds the add prefix middleware configuration. This middleware updates the path of a request before forwarding it. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/addprefix/
basic_auth: Option<MiddlewareBasicAuth>
BasicAuth holds the basic auth middleware configuration. This middleware restricts access to your services to known users. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/basicauth/
buffering: Option<MiddlewareBuffering>
Buffering holds the buffering middleware configuration. This middleware retries or limits the size of requests that can be forwarded to backends. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/buffering/#maxrequestbodybytes
chain: Option<MiddlewareChain>
Chain holds the configuration of the chain middleware. This middleware enables to define reusable combinations of other pieces of middleware. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/chain/
circuit_breaker: Option<MiddlewareCircuitBreaker>
CircuitBreaker holds the circuit breaker configuration.
compress: Option<MiddlewareCompress>
Compress holds the compress middleware configuration. This middleware compresses responses before sending them to the client, using gzip, brotli, or zstd compression. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/compress/
content_type: Option<MiddlewareContentType>
ContentType holds the content-type middleware configuration. This middleware exists to enable the correct behavior until at least the default one can be changed in a future version.
digest_auth: Option<MiddlewareDigestAuth>
DigestAuth holds the digest auth middleware configuration. This middleware restricts access to your services to known users. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/digestauth/
errors: Option<MiddlewareErrors>
ErrorPage holds the custom error middleware configuration. This middleware returns a custom page in lieu of the default, according to configured ranges of HTTP Status codes. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/errorpages/
forward_auth: Option<MiddlewareForwardAuth>
ForwardAuth holds the forward auth middleware configuration. This middleware delegates the request authentication to a Service. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/forwardauth/
grpc_web: Option<MiddlewareGrpcWeb>
GrpcWeb holds the gRPC web middleware configuration. This middleware converts a gRPC web request to an HTTP/2 gRPC request.
headers: Option<MiddlewareHeaders>
Headers holds the headers middleware configuration. This middleware manages the requests and responses headers. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/headers/#customrequestheaders
in_flight_req: Option<MiddlewareInFlightReq>
InFlightReq holds the in-flight request middleware configuration. This middleware limits the number of requests being processed and served concurrently. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/inflightreq/
ip_allow_list: Option<MiddlewareIpAllowList>
IPAllowList holds the IP allowlist middleware configuration. This middleware limits allowed requests based on the client IP. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/ipallowlist/
ip_white_list: Option<MiddlewareIpWhiteList>
Deprecated: please use IPAllowList instead.
pass_tls_client_cert: Option<MiddlewarePassTlsClientCert>
PassTLSClientCert holds the pass TLS client cert middleware configuration. This middleware adds the selected data from the passed client TLS certificate to a header. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/passtlsclientcert/
plugin: Option<BTreeMap<String, Value>>
Plugin defines the middleware plugin configuration. More info: https://doc.traefik.io/traefik/plugins/
rate_limit: Option<MiddlewareRateLimit>
RateLimit holds the rate limit configuration. This middleware ensures that services will receive a fair amount of requests, and allows one to define what fair is. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/ratelimit/
redirect_regex: Option<MiddlewareRedirectRegex>
RedirectRegex holds the redirect regex middleware configuration. This middleware redirects a request using regex matching and replacement. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/redirectregex/#regex
redirect_scheme: Option<MiddlewareRedirectScheme>
RedirectScheme holds the redirect scheme middleware configuration. This middleware redirects requests from a scheme/port to another. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/redirectscheme/
replace_path: Option<MiddlewareReplacePath>
ReplacePath holds the replace path middleware configuration. This middleware replaces the path of the request URL and store the original path in an X-Replaced-Path header. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/replacepath/
replace_path_regex: Option<MiddlewareReplacePathRegex>
ReplacePathRegex holds the replace path regex middleware configuration. This middleware replaces the path of a URL using regex matching and replacement. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/replacepathregex/
retry: Option<MiddlewareRetry>
Retry holds the retry middleware configuration. This middleware reissues requests a given number of times to a backend server if that server does not reply. As soon as the server answers, the middleware stops retrying, regardless of the response status. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/retry/
strip_prefix: Option<MiddlewareStripPrefix>
StripPrefix holds the strip prefix middleware configuration. This middleware removes the specified prefixes from the URL path. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/stripprefix/
strip_prefix_regex: Option<MiddlewareStripPrefixRegex>
StripPrefixRegex holds the strip prefix regex middleware configuration. This middleware removes the matching prefixes from the URL path. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/stripprefixregex/
Implementations§
Source§impl MiddlewareSpec
impl MiddlewareSpec
Sourcepub fn builder() -> MiddlewareSpecBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> MiddlewareSpecBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building MiddlewareSpec
.
On the builder, call .add_prefix(...)
(optional), .basic_auth(...)
(optional), .buffering(...)
(optional), .chain(...)
(optional), .circuit_breaker(...)
(optional), .compress(...)
(optional), .content_type(...)
(optional), .digest_auth(...)
(optional), .errors(...)
(optional), .forward_auth(...)
(optional), .grpc_web(...)
(optional), .headers(...)
(optional), .in_flight_req(...)
(optional), .ip_allow_list(...)
(optional), .ip_white_list(...)
(optional), .pass_tls_client_cert(...)
(optional), .plugin(...)
(optional), .rate_limit(...)
(optional), .redirect_regex(...)
(optional), .redirect_scheme(...)
(optional), .replace_path(...)
(optional), .replace_path_regex(...)
(optional), .retry(...)
(optional), .strip_prefix(...)
(optional), .strip_prefix_regex(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MiddlewareSpec
.
Trait Implementations§
Source§impl Clone for MiddlewareSpec
impl Clone for MiddlewareSpec
Source§fn clone(&self) -> MiddlewareSpec
fn clone(&self) -> MiddlewareSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MiddlewareSpec
impl Debug for MiddlewareSpec
Source§impl Default for MiddlewareSpec
impl Default for MiddlewareSpec
Source§fn default() -> MiddlewareSpec
fn default() -> MiddlewareSpec
Source§impl<'de> Deserialize<'de> for MiddlewareSpec
impl<'de> Deserialize<'de> for MiddlewareSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MiddlewareSpec
impl JsonSchema for MiddlewareSpec
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for MiddlewareSpec
impl PartialEq for MiddlewareSpec
Source§impl Serialize for MiddlewareSpec
impl Serialize for MiddlewareSpec
impl StructuralPartialEq for MiddlewareSpec
Auto Trait Implementations§
impl Freeze for MiddlewareSpec
impl RefUnwindSafe for MiddlewareSpec
impl Send for MiddlewareSpec
impl Sync for MiddlewareSpec
impl Unpin for MiddlewareSpec
impl UnwindSafe for MiddlewareSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more