diff --git a/api/v1alpha1/shared_types.go b/api/v1alpha1/shared_types.go
index d33f6544d3..e8c3a0b687 100644
--- a/api/v1alpha1/shared_types.go
+++ b/api/v1alpha1/shared_types.go
@@ -1052,6 +1052,20 @@ type CustomRedirect struct {
// multiple values for a header must use RFC 7230 header value formatting,
// separating each value with a comma.
type HTTPHeaderFilter struct {
+ // Mutations is an ordered list of header operations that are applied in
+ // exactly the order specified. Use this field when the sequence of
+ // operations matters, for example setting a header and then appending to
+ // it, or removing a header and then re-adding it.
+ //
+ // Mutations are always applied FIRST, in list order. The Set, Add,
+ // AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ // the mutations, preserving their existing ordering (Add, then Set, then
+ // AddIfAbsent, then Remove, then RemoveOnMatch).
+ //
+ // +optional
+ // +kubebuilder:validation:MaxItems=64
+ Mutations []HTTPHeaderMutation `json:"mutations,omitempty"`
+
// Set overwrites the request with the given header (name, value)
// before the action.
//
@@ -1156,6 +1170,75 @@ type HTTPHeaderFilter struct {
RemoveOnMatch []StringMatch `json:"removeOnMatch,omitempty"`
}
+// HTTPHeaderMutation defines a single header mutation operation.
+//
+// +kubebuilder:validation:MaxProperties=1
+// +kubebuilder:validation:MinProperties=1
+type HTTPHeaderMutation struct {
+ // Write adds or modifies a header using the specified action.
+ //
+ // +optional
+ Write *HTTPHeaderWrite `json:"write,omitempty"`
+
+ // Remove removes the named header if it exists. Header names are
+ // case-insensitive.
+ //
+ // +optional
+ Remove *string `json:"remove,omitempty"`
+
+ // RemoveOnMatch removes every header whose name matches the specified string
+ // matcher. Matching is performed on the header name (case-insensitive).
+ //
+ // +optional
+ RemoveOnMatch *StringMatch `json:"removeOnMatch,omitempty"`
+}
+
+// HTTPHeaderWrite defines a header to write and how it should be applied when a
+// header with the same name already exists. It mirrors Envoy's
+// core.v3.HeaderValueOption.
+type HTTPHeaderWrite struct {
+ // Header is the header name and value to write.
+ Header gwapiv1.HTTPHeader `json:"header"`
+
+ // Action controls how the header value is written when a header with the
+ // same name already exists. Defaults to Append.
+ //
+ // +optional
+ // +kubebuilder:default=Append
+ Action HeaderWriteAction `json:"action,omitempty"`
+
+ // KeepEmptyValue controls whether a header with an empty value is kept.
+ // When unset, an empty value is kept only if the provided value is empty.
+ //
+ // +optional
+ KeepEmptyValue *bool `json:"keepEmptyValue,omitempty"`
+}
+
+// HeaderWriteAction controls how a header value is written when a header with
+// the same name already exists. The values mirror Envoy's
+// HeaderValueOption.HeaderAppendAction.
+//
+// +kubebuilder:validation:Enum=Append;Overwrite;AddIfAbsent;OverwriteIfExists
+type HeaderWriteAction string
+
+const (
+ // HeaderWriteAppend appends the value if the header exists, or adds the
+ // header otherwise. (Envoy: APPEND_IF_EXISTS_OR_ADD)
+ HeaderWriteAppend HeaderWriteAction = "Append"
+
+ // HeaderWriteOverwrite overwrites the value if the header exists, or adds
+ // the header otherwise. (Envoy: OVERWRITE_IF_EXISTS_OR_ADD)
+ HeaderWriteOverwrite HeaderWriteAction = "Overwrite"
+
+ // HeaderWriteAddIfAbsent adds the header only if it is not already present.
+ // (Envoy: ADD_IF_ABSENT)
+ HeaderWriteAddIfAbsent HeaderWriteAction = "AddIfAbsent"
+
+ // HeaderWriteOverwriteIfExists overwrites the value only if the header is
+ // already present, and does nothing otherwise. (Envoy: OVERWRITE_IF_EXISTS)
+ HeaderWriteOverwriteIfExists HeaderWriteAction = "OverwriteIfExists"
+)
+
// LocalObjectKeyReference selects a key from a local object.
type LocalObjectKeyReference struct {
// The local object to select from.
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
index 7245a49145..a36a6e723b 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -4485,6 +4485,13 @@ func (in *HTTPExtAuthService) DeepCopy() *HTTPExtAuthService {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPHeaderFilter) DeepCopyInto(out *HTTPHeaderFilter) {
*out = *in
+ if in.Mutations != nil {
+ in, out := &in.Mutations, &out.Mutations
+ *out = make([]HTTPHeaderMutation, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
if in.Set != nil {
in, out := &in.Set, &out.Set
*out = make([]v1.HTTPHeader, len(*in))
@@ -4524,6 +4531,57 @@ func (in *HTTPHeaderFilter) DeepCopy() *HTTPHeaderFilter {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HTTPHeaderMutation) DeepCopyInto(out *HTTPHeaderMutation) {
+ *out = *in
+ if in.Write != nil {
+ in, out := &in.Write, &out.Write
+ *out = new(HTTPHeaderWrite)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Remove != nil {
+ in, out := &in.Remove, &out.Remove
+ *out = new(string)
+ **out = **in
+ }
+ if in.RemoveOnMatch != nil {
+ in, out := &in.RemoveOnMatch, &out.RemoveOnMatch
+ *out = new(StringMatch)
+ (*in).DeepCopyInto(*out)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPHeaderMutation.
+func (in *HTTPHeaderMutation) DeepCopy() *HTTPHeaderMutation {
+ if in == nil {
+ return nil
+ }
+ out := new(HTTPHeaderMutation)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HTTPHeaderWrite) DeepCopyInto(out *HTTPHeaderWrite) {
+ *out = *in
+ out.Header = in.Header
+ if in.KeepEmptyValue != nil {
+ in, out := &in.KeepEmptyValue, &out.KeepEmptyValue
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPHeaderWrite.
+func (in *HTTPHeaderWrite) DeepCopy() *HTTPHeaderWrite {
+ if in == nil {
+ return nil
+ }
+ out := new(HTTPHeaderWrite)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPHostnameModifier) DeepCopyInto(out *HTTPHostnameModifier) {
*out = *in
diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
index b873c582aa..d18bb63aae 100644
--- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
+++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
@@ -380,6 +380,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
@@ -634,6 +740,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
index 5b73c4161a..f7c14cd8ca 100644
--- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
+++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml
@@ -379,6 +379,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
@@ -633,6 +739,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md
index 66d6c6cd5a..491aed6ddc 100644
--- a/site/content/en/latest/api/extension_types.md
+++ b/site/content/en/latest/api/extension_types.md
@@ -3087,6 +3087,7 @@ _Appears in:_
| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
+| `mutations` | _[HTTPHeaderMutation](#httpheadermutation) array_ | false | | Mutations is an ordered list of header operations that are applied in
exactly the order specified. Use this field when the sequence of
operations matters, for example setting a header and then appending to
it, or removing a header and then re-adding it.
Mutations are always applied FIRST, in list order. The Set, Add,
AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
the mutations, preserving their existing ordering (Add, then Set, then
AddIfAbsent, then Remove, then RemoveOnMatch). |
| `set` | _[HTTPHeader](#httpheader) array_ | false | | Set overwrites the request with the given header (name, value)
before the action.
Input:
GET /foo HTTP/1.1
my-header: foo
Config:
set:
- name: "my-header"
value: "bar"
Output:
GET /foo HTTP/1.1
my-header: bar |
| `add` | _[HTTPHeader](#httpheader) array_ | false | | Add adds the given header(s) (name, value) to the request
before the action. It appends to any existing values associated
with the header name.
Input:
GET /foo HTTP/1.1
my-header: foo
Config:
add:
- name: "my-header"
value: "bar,baz"
Output:
GET /foo HTTP/1.1
my-header: foo,bar,baz |
| `addIfAbsent` | _[HTTPHeader](#httpheader) array_ | false | | AddIfAbsent adds the given header(s) (name, value) to the request/response
only if the header does not already exist. Unlike Add which appends to
existing values, this is a no-op if the header is already present.
Input:
GET /foo HTTP/1.1
my-header: foo
Config:
addIfAbsent:
- name: "my-header"
value: "bar"
Output:
GET /foo HTTP/1.1
my-header: foo |
@@ -3094,6 +3095,40 @@ _Appears in:_
| `removeOnMatch` | _[StringMatch](#stringmatch) array_ | false | | RemoveOnMatch removes headers whose names match the specified string matchers.
Matching is performed on the header name (case-insensitive). |
+#### HTTPHeaderMutation
+
+
+
+HTTPHeaderMutation defines a single header mutation operation.
+
+_Appears in:_
+- [HTTPHeaderFilter](#httpheaderfilter)
+
+| Field | Type | Required | Default | Description |
+| --- | --- | --- | --- | --- |
+| `write` | _[HTTPHeaderWrite](#httpheaderwrite)_ | false | | Write adds or modifies a header using the specified action. |
+| `remove` | _string_ | false | | Remove removes the named header if it exists. Header names are
case-insensitive. |
+| `removeOnMatch` | _[StringMatch](#stringmatch)_ | false | | RemoveOnMatch removes every header whose name matches the specified string
matcher. Matching is performed on the header name (case-insensitive). |
+
+
+#### HTTPHeaderWrite
+
+
+
+HTTPHeaderWrite defines a header to write and how it should be applied when a
+header with the same name already exists. It mirrors Envoy's
+core.v3.HeaderValueOption.
+
+_Appears in:_
+- [HTTPHeaderMutation](#httpheadermutation)
+
+| Field | Type | Required | Default | Description |
+| --- | --- | --- | --- | --- |
+| `header` | _[HTTPHeader](#httpheader)_ | true | | Header is the header name and value to write. |
+| `action` | _[HeaderWriteAction](#headerwriteaction)_ | false | Append | Action controls how the header value is written when a header with the
same name already exists. Defaults to Append. |
+| `keepEmptyValue` | _boolean_ | false | | KeepEmptyValue controls whether a header with an empty value is kept.
When unset, an empty value is kept only if the provided value is empty. |
+
+
#### HTTPHostnameModifier
@@ -3350,6 +3385,25 @@ _Appears in:_
| `host` | _[HostSettings](#hostsettings)_ | false | | Host enables managing how the Host/Authority header set by clients can be normalized. |
+#### HeaderWriteAction
+
+_Underlying type:_ _string_
+
+HeaderWriteAction controls how a header value is written when a header with
+the same name already exists. The values mirror Envoy's
+HeaderValueOption.HeaderAppendAction.
+
+_Appears in:_
+- [HTTPHeaderWrite](#httpheaderwrite)
+
+| Value | Description |
+| ----- | ----------- |
+| `Append` | HeaderWriteAppend appends the value if the header exists, or adds the
header otherwise. (Envoy: APPEND_IF_EXISTS_OR_ADD)
|
+| `Overwrite` | HeaderWriteOverwrite overwrites the value if the header exists, or adds
the header otherwise. (Envoy: OVERWRITE_IF_EXISTS_OR_ADD)
|
+| `AddIfAbsent` | HeaderWriteAddIfAbsent adds the header only if it is not already present.
(Envoy: ADD_IF_ABSENT)
|
+| `OverwriteIfExists` | HeaderWriteOverwriteIfExists overwrites the value only if the header is
already present, and does nothing otherwise. (Envoy: OVERWRITE_IF_EXISTS)
|
+
+
#### HealthCheck
@@ -6086,6 +6140,7 @@ that need to match against a string.
_Appears in:_
- [HTTP1Settings](#http1settings)
- [HTTPHeaderFilter](#httpheaderfilter)
+- [HTTPHeaderMutation](#httpheadermutation)
- [OIDCDenyRedirectHeader](#oidcdenyredirectheader)
- [OtherSANMatch](#othersanmatch)
- [ProxyMetrics](#proxymetrics)
diff --git a/test/cel-validation/clienttrafficpolicy_test.go b/test/cel-validation/clienttrafficpolicy_test.go
index 4c5d11f621..eef7de7883 100644
--- a/test/cel-validation/clienttrafficpolicy_test.go
+++ b/test/cel-validation/clienttrafficpolicy_test.go
@@ -795,6 +795,110 @@ func TestClientTrafficPolicyTarget(t *testing.T) {
": preserveXRequestID and requestID cannot both be set.",
},
},
+ {
+ desc: "valid header mutations",
+ mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
+ ctp.Spec = egv1a1.ClientTrafficPolicySpec{
+ PolicyTargetReferences: egv1a1.PolicyTargetReferences{
+ TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{
+ LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{
+ Group: gwapiv1.Group("gateway.networking.k8s.io"),
+ Kind: gwapiv1.Kind("Gateway"),
+ Name: gwapiv1.ObjectName("eg"),
+ },
+ },
+ },
+ Headers: &egv1a1.HeaderSettings{
+ EarlyRequestHeaders: &egv1a1.HTTPHeaderFilter{
+ Mutations: []egv1a1.HTTPHeaderMutation{
+ {Write: &egv1a1.HTTPHeaderWrite{Header: gwapiv1.HTTPHeader{Name: "x-foo", Value: "bar"}, Action: egv1a1.HeaderWriteOverwrite}},
+ {Remove: new("x-baz")},
+ },
+ },
+ },
+ }
+ },
+ wantErrors: []string{},
+ },
+ {
+ desc: "header mutation with no action set",
+ mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
+ ctp.Spec = egv1a1.ClientTrafficPolicySpec{
+ PolicyTargetReferences: egv1a1.PolicyTargetReferences{
+ TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{
+ LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{
+ Group: gwapiv1.Group("gateway.networking.k8s.io"),
+ Kind: gwapiv1.Kind("Gateway"),
+ Name: gwapiv1.ObjectName("eg"),
+ },
+ },
+ },
+ Headers: &egv1a1.HeaderSettings{
+ EarlyRequestHeaders: &egv1a1.HTTPHeaderFilter{
+ Mutations: []egv1a1.HTTPHeaderMutation{{}},
+ },
+ },
+ }
+ },
+ wantErrors: []string{
+ "spec.headers.earlyRequestHeaders.mutations[0]",
+ },
+ },
+ {
+ desc: "header mutation with more than one action set",
+ mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
+ ctp.Spec = egv1a1.ClientTrafficPolicySpec{
+ PolicyTargetReferences: egv1a1.PolicyTargetReferences{
+ TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{
+ LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{
+ Group: gwapiv1.Group("gateway.networking.k8s.io"),
+ Kind: gwapiv1.Kind("Gateway"),
+ Name: gwapiv1.ObjectName("eg"),
+ },
+ },
+ },
+ Headers: &egv1a1.HeaderSettings{
+ EarlyRequestHeaders: &egv1a1.HTTPHeaderFilter{
+ Mutations: []egv1a1.HTTPHeaderMutation{
+ {
+ Write: &egv1a1.HTTPHeaderWrite{Header: gwapiv1.HTTPHeader{Name: "x-foo", Value: "bar"}},
+ Remove: new("x-baz"),
+ },
+ },
+ },
+ },
+ }
+ },
+ wantErrors: []string{
+ "spec.headers.earlyRequestHeaders.mutations[0]",
+ },
+ },
+ {
+ desc: "header mutation with invalid write action",
+ mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
+ ctp.Spec = egv1a1.ClientTrafficPolicySpec{
+ PolicyTargetReferences: egv1a1.PolicyTargetReferences{
+ TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{
+ LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{
+ Group: gwapiv1.Group("gateway.networking.k8s.io"),
+ Kind: gwapiv1.Kind("Gateway"),
+ Name: gwapiv1.ObjectName("eg"),
+ },
+ },
+ },
+ Headers: &egv1a1.HeaderSettings{
+ EarlyRequestHeaders: &egv1a1.HTTPHeaderFilter{
+ Mutations: []egv1a1.HTTPHeaderMutation{
+ {Write: &egv1a1.HTTPHeaderWrite{Header: gwapiv1.HTTPHeader{Name: "x-foo", Value: "bar"}, Action: egv1a1.HeaderWriteAction("Bogus")}},
+ },
+ },
+ },
+ }
+ },
+ wantErrors: []string{
+ "spec.headers.earlyRequestHeaders.mutations[0].write.action",
+ },
+ },
}
for _, tc := range cases {
diff --git a/test/helm/gateway-crds-helm/all.out.yaml b/test/helm/gateway-crds-helm/all.out.yaml
index 31f9836eeb..71eb06dca2 100644
--- a/test/helm/gateway-crds-helm/all.out.yaml
+++ b/test/helm/gateway-crds-helm/all.out.yaml
@@ -28739,6 +28739,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
@@ -28993,6 +29099,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
diff --git a/test/helm/gateway-crds-helm/e2e.out.yaml b/test/helm/gateway-crds-helm/e2e.out.yaml
index 02b6065f79..77f321f5be 100644
--- a/test/helm/gateway-crds-helm/e2e.out.yaml
+++ b/test/helm/gateway-crds-helm/e2e.out.yaml
@@ -4677,6 +4677,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
@@ -4931,6 +5037,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
diff --git a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml
index 0b1d7764f0..521bf38099 100644
--- a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml
+++ b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml
@@ -4677,6 +4677,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The
@@ -4931,6 +5037,112 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
+ mutations:
+ description: |-
+ Mutations is an ordered list of header operations that are applied in
+ exactly the order specified. Use this field when the sequence of
+ operations matters, for example setting a header and then appending to
+ it, or removing a header and then re-adding it.
+
+ Mutations are always applied FIRST, in list order. The Set, Add,
+ AddIfAbsent, Remove and RemoveOnMatch fields below are then applied after
+ the mutations, preserving their existing ordering (Add, then Set, then
+ AddIfAbsent, then Remove, then RemoveOnMatch).
+ items:
+ description: HTTPHeaderMutation defines a single header
+ mutation operation.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ remove:
+ description: |-
+ Remove removes the named header if it exists. Header names are
+ case-insensitive.
+ type: string
+ removeOnMatch:
+ description: |-
+ RemoveOnMatch removes every header whose name matches the specified string
+ matcher. Matching is performed on the header name (case-insensitive).
+ properties:
+ type:
+ default: Exact
+ description: Type specifies how to match against
+ a string.
+ enum:
+ - Exact
+ - Prefix
+ - Suffix
+ - RegularExpression
+ type: string
+ value:
+ description: Value specifies the string value that
+ the match must have.
+ maxLength: 1024
+ minLength: 1
+ type: string
+ required:
+ - value
+ type: object
+ write:
+ description: Write adds or modifies a header using the
+ specified action.
+ properties:
+ action:
+ default: Append
+ description: |-
+ Action controls how the header value is written when a header with the
+ same name already exists. Defaults to Append.
+ enum:
+ - Append
+ - Overwrite
+ - AddIfAbsent
+ - OverwriteIfExists
+ type: string
+ header:
+ description: Header is the header name and value
+ to write.
+ properties:
+ name:
+ description: |-
+ Name is the name of the HTTP Header to be matched. Name matching MUST be
+ case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
+
+ If multiple entries specify equivalent header names, the first entry with
+ an equivalent name MUST be considered for a match. Subsequent entries
+ with an equivalent header name MUST be ignored. Due to the
+ case-insensitivity of header names, "foo" and "Foo" are considered
+ equivalent.
+ maxLength: 256
+ minLength: 1
+ pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
+ type: string
+ value:
+ description: |-
+ Value is the value of HTTP Header to be matched.
+
+ Must consist of printable US-ASCII characters, optionally separated
+ by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
+
+
+
+ maxLength: 4096
+ minLength: 1
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ keepEmptyValue:
+ description: |-
+ KeepEmptyValue controls whether a header with an empty value is kept.
+ When unset, an empty value is kept only if the provided value is empty.
+ type: boolean
+ required:
+ - header
+ type: object
+ type: object
+ maxItems: 64
+ type: array
remove:
description: |-
Remove the given header(s) from the HTTP request before the action. The