pub struct HeaderMutationRules {
pub allow_all_routing: Option<BoolValue>,
pub allow_envoy: Option<BoolValue>,
pub disallow_system: Option<BoolValue>,
pub disallow_all: Option<BoolValue>,
pub allow_expression: Option<RegexMatcher>,
pub disallow_expression: Option<RegexMatcher>,
pub disallow_is_error: Option<BoolValue>,
}
Expand description
The HeaderMutationRules structure specifies what headers may be manipulated by a processing filter. This set of rules makes it possible to control which modifications a filter may make.
By default, an external processing server may add, modify, or remove any header except for an “Envoy internal” header (which is typically denoted by an x-envoy prefix) or specific headers that may affect further filter processing:
host
:authority
:scheme
:method
Every attempt to add, change, append, or remove a header will be
tested against the rules here. Disallowed header mutations will be
ignored unless disallow_is_error
is set to true.
Attempts to remove headers are further constrained – regardless of the
settings, system-defined headers (that start with :
) and the host
header may never be removed.
In addition, a counter will be incremented whenever a mutation is
rejected. In the ext_proc filter, that counter is named
rejected_header_mutations
.
[#next-free-field: 8]
Fields§
§allow_all_routing: Option<BoolValue>
By default, certain headers that could affect processing of subsequent
filters or request routing cannot be modified. These headers are
host
, :authority
, :scheme
, and :method
. Setting this parameter
to true allows these headers to be modified as well.
allow_envoy: Option<BoolValue>
If true, allow modification of envoy internal headers. By default, these
start with x-envoy
but this may be overridden in the Bootstrap
configuration using the
:ref:header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>
field. Default is false.
disallow_system: Option<BoolValue>
If true, prevent modification of any system header, defined as a header
that starts with a :
character, regardless of any other settings.
A processing server may still override the :status
of an HTTP response
using an ImmediateResponse
message. Default is false.
disallow_all: Option<BoolValue>
If true, prevent modifications of all header values, regardless of any
other settings. A processing server may still override the :status
of an HTTP response using an ImmediateResponse
message. Default is false.
allow_expression: Option<RegexMatcher>
If set, specifically allow any header that matches this regular
expression. This overrides all other settings except for
disallow_expression
.
disallow_expression: Option<RegexMatcher>
If set, specifically disallow any header that matches this regular expression regardless of any other settings.
disallow_is_error: Option<BoolValue>
If true, and if the rules in this list cause a header mutation to be
disallowed, then the filter using this configuration will terminate the
request with a 500 error. In addition, regardless of the setting of this
parameter, any attempt to set, add, or modify a disallowed header will
cause the rejected_header_mutations
counter to be incremented.
Default is false.
Trait Implementations§
Source§impl Clone for HeaderMutationRules
impl Clone for HeaderMutationRules
Source§fn clone(&self) -> HeaderMutationRules
fn clone(&self) -> HeaderMutationRules
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for HeaderMutationRules
impl Debug for HeaderMutationRules
Source§impl Default for HeaderMutationRules
impl Default for HeaderMutationRules
Source§impl Message for HeaderMutationRules
impl Message for HeaderMutationRules
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl Name for HeaderMutationRules
impl Name for HeaderMutationRules
Source§const NAME: &'static str = "HeaderMutationRules"
const NAME: &'static str = "HeaderMutationRules"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.Source§const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3"
const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3"
.
, e.g. google.protobuf
.Source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.Source§impl PartialEq for HeaderMutationRules
impl PartialEq for HeaderMutationRules
impl StructuralPartialEq for HeaderMutationRules
Auto Trait Implementations§
impl Freeze for HeaderMutationRules
impl RefUnwindSafe for HeaderMutationRules
impl Send for HeaderMutationRules
impl Sync for HeaderMutationRules
impl Unpin for HeaderMutationRules
impl UnwindSafe for HeaderMutationRules
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request