xds_api/generated/envoy.config.common.mutation_rules.v3.rs
1// This file is @generated by prost-build.
2/// The HeaderMutationRules structure specifies what headers may be
3/// manipulated by a processing filter. This set of rules makes it
4/// possible to control which modifications a filter may make.
5///
6/// By default, an external processing server may add, modify, or remove
7/// any header except for an "Envoy internal" header (which is typically
8/// denoted by an x-envoy prefix) or specific headers that may affect
9/// further filter processing:
10///
11/// * ``host``
12/// * ``:authority``
13/// * ``:scheme``
14/// * ``:method``
15///
16/// Every attempt to add, change, append, or remove a header will be
17/// tested against the rules here. Disallowed header mutations will be
18/// ignored unless ``disallow_is_error`` is set to true.
19///
20/// Attempts to remove headers are further constrained -- regardless of the
21/// settings, system-defined headers (that start with ``:``) and the ``host``
22/// header may never be removed.
23///
24/// In addition, a counter will be incremented whenever a mutation is
25/// rejected. In the ext_proc filter, that counter is named
26/// ``rejected_header_mutations``.
27/// \[#next-free-field: 8\]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct HeaderMutationRules {
30 /// By default, certain headers that could affect processing of subsequent
31 /// filters or request routing cannot be modified. These headers are
32 /// ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter
33 /// to true allows these headers to be modified as well.
34 #[prost(message, optional, tag = "1")]
35 pub allow_all_routing: ::core::option::Option<
36 super::super::super::super::super::google::protobuf::BoolValue,
37 >,
38 /// If true, allow modification of envoy internal headers. By default, these
39 /// start with ``x-envoy`` but this may be overridden in the ``Bootstrap``
40 /// configuration using the
41 /// :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
42 /// field. Default is false.
43 #[prost(message, optional, tag = "2")]
44 pub allow_envoy: ::core::option::Option<
45 super::super::super::super::super::google::protobuf::BoolValue,
46 >,
47 /// If true, prevent modification of any system header, defined as a header
48 /// that starts with a ``:`` character, regardless of any other settings.
49 /// A processing server may still override the ``:status`` of an HTTP response
50 /// using an ``ImmediateResponse`` message. Default is false.
51 #[prost(message, optional, tag = "3")]
52 pub disallow_system: ::core::option::Option<
53 super::super::super::super::super::google::protobuf::BoolValue,
54 >,
55 /// If true, prevent modifications of all header values, regardless of any
56 /// other settings. A processing server may still override the ``:status``
57 /// of an HTTP response using an ``ImmediateResponse`` message. Default is false.
58 #[prost(message, optional, tag = "4")]
59 pub disallow_all: ::core::option::Option<
60 super::super::super::super::super::google::protobuf::BoolValue,
61 >,
62 /// If set, specifically allow any header that matches this regular
63 /// expression. This overrides all other settings except for
64 /// ``disallow_expression``.
65 #[prost(message, optional, tag = "5")]
66 pub allow_expression: ::core::option::Option<
67 super::super::super::super::r#type::matcher::v3::RegexMatcher,
68 >,
69 /// If set, specifically disallow any header that matches this regular
70 /// expression regardless of any other settings.
71 #[prost(message, optional, tag = "6")]
72 pub disallow_expression: ::core::option::Option<
73 super::super::super::super::r#type::matcher::v3::RegexMatcher,
74 >,
75 /// If true, and if the rules in this list cause a header mutation to be
76 /// disallowed, then the filter using this configuration will terminate the
77 /// request with a 500 error. In addition, regardless of the setting of this
78 /// parameter, any attempt to set, add, or modify a disallowed header will
79 /// cause the ``rejected_header_mutations`` counter to be incremented.
80 /// Default is false.
81 #[prost(message, optional, tag = "7")]
82 pub disallow_is_error: ::core::option::Option<
83 super::super::super::super::super::google::protobuf::BoolValue,
84 >,
85}
86impl ::prost::Name for HeaderMutationRules {
87 const NAME: &'static str = "HeaderMutationRules";
88 const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3";
89 fn full_name() -> ::prost::alloc::string::String {
90 "envoy.config.common.mutation_rules.v3.HeaderMutationRules".into()
91 }
92 fn type_url() -> ::prost::alloc::string::String {
93 "type.googleapis.com/envoy.config.common.mutation_rules.v3.HeaderMutationRules"
94 .into()
95 }
96}
97/// The HeaderMutation structure specifies an action that may be taken on HTTP
98/// headers.
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct HeaderMutation {
101 #[prost(oneof = "header_mutation::Action", tags = "1, 2")]
102 pub action: ::core::option::Option<header_mutation::Action>,
103}
104/// Nested message and enum types in `HeaderMutation`.
105pub mod header_mutation {
106 #[derive(Clone, PartialEq, ::prost::Oneof)]
107 pub enum Action {
108 /// Remove the specified header if it exists.
109 #[prost(string, tag = "1")]
110 Remove(::prost::alloc::string::String),
111 /// Append new header by the specified HeaderValueOption.
112 #[prost(message, tag = "2")]
113 Append(super::super::super::super::core::v3::HeaderValueOption),
114 }
115}
116impl ::prost::Name for HeaderMutation {
117 const NAME: &'static str = "HeaderMutation";
118 const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3";
119 fn full_name() -> ::prost::alloc::string::String {
120 "envoy.config.common.mutation_rules.v3.HeaderMutation".into()
121 }
122 fn type_url() -> ::prost::alloc::string::String {
123 "type.googleapis.com/envoy.config.common.mutation_rules.v3.HeaderMutation".into()
124 }
125}