transformation_filter.proto

Package : envoy.api.v2.filter.http

Top

transformation_filter.proto

Table of Contents

Extraction

Field Type Label Description
header string Extract information from headers
body google.protobuf.Empty Extract information from the request/response body
regex string Only strings matching this regular expression will be part of the extraction. The most simple value for this field is ‘.*', which matches the whole source. The field is required. If extraction fails the result is an empty value.
subgroup uint32 If your regex contains capturing groups, use this field to determine which group should be selected.

FilterTransformations

Field Type Label Description
transformations []envoy.api.v2.filter.http.TransformationRule repeated Specifies transformations based on the route matches. The first matched transformation will be applied. If there are overlapped match conditions, please put the most specific match first.
stage uint32 Only RouteTransformations.RouteTransformation with matching stage will be used with this filter.

HeaderBodyTransform

InjaTemplate

Field Type Label Description
text string

MergeExtractorsToBody

Passthrough

ResponseMatcher

Field Type Label Description
headers []envoy.config.route.v3.HeaderMatcher repeated Specifies a set of headers that the route should match on. The router will check the response headers against all the specified headers in the route config. A match will happen if all the headers in the route are present in the request with the same values (or based on presence if the value field is not in the config).
responseCodeDetails envoy.type.matcher.v3.StringMatcher Only match responses with non empty response code details (this usually implies a local reply).

ResponseTransformationRule

Field Type Label Description
match envoy.api.v2.filter.http.ResponseMatcher
responseTransformation envoy.api.v2.filter.http.Transformation transformation to perform

RouteTransformations

Field Type Label Description
requestTransformation envoy.api.v2.filter.http.Transformation deprecated. Use transformations[].request_match.request_transformation instead.
responseTransformation envoy.api.v2.filter.http.Transformation deprecated. Use transformations[].request_match.response_transformation instead.
clearRouteCache bool deprecated. Use transformations[].request_match.clear_route_cache instead.
transformations []envoy.api.v2.filter.http.RouteTransformations.RouteTransformation repeated

RouteTransformations.RouteTransformation

Field Type Label Description
stage uint32 Stage number. This transformation will only be processed by filters with the same stage number.
requestMatch envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.RequestMatch
responseMatch envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.ResponseMatch

RouteTransformations.RouteTransformation.RequestMatch

Field Type Label Description
match envoy.config.route.v3.RouteMatch if no match is specified, will match all
requestTransformation envoy.api.v2.filter.http.Transformation transformation to perform
responseTransformation envoy.api.v2.filter.http.Transformation
clearRouteCache bool clear the route cache if the request transformation was applied

RouteTransformations.RouteTransformation.ResponseMatch

Field Type Label Description
match envoy.api.v2.filter.http.ResponseMatcher
responseTransformation envoy.api.v2.filter.http.Transformation transformation to perform

Transformation

Field Type Label Description
transformationTemplate envoy.api.v2.filter.http.TransformationTemplate Apply transformation templates.
headerBodyTransform envoy.api.v2.filter.http.HeaderBodyTransform This type of transformation will make all the headers available in the response body. The resulting JSON body will consist of two attributes: ‘headers’, containing the headers, and ‘body’, containing the original body.
transformerConfig envoy.config.core.v3.TypedExtensionConfig Configuration for an externally implemented transformer.

TransformationRule

Field Type Label Description
match envoy.config.route.v3.RouteMatch The route matching parameter. Only when the match is satisfied, the “requires” field will apply.
For example: following match will match all requests.
.. code-block:: yaml
match: prefix: /
routeTransformations envoy.api.v2.filter.http.TransformationRule.Transformations transformation to perform

TransformationRule.Transformations

Field Type Label Description
requestTransformation envoy.api.v2.filter.http.Transformation Apply a transformation to requests.
clearRouteCache bool Clear the route cache if the request transformation was applied.
responseTransformation envoy.api.v2.filter.http.Transformation Apply a transformation to responses.
onStreamCompletionTransformation envoy.api.v2.filter.http.Transformation Apply a transformation in the onStreamComplete callback

TransformationTemplate

Field Type Label Description
advancedTemplates bool If set to true, use JSON pointer notation (e.g. “time/start”) instead of dot notation (e.g. “time.start”) to access JSON elements. Defaults to false.
Please note that, if set to ‘true’, you will need to use the extraction function to access extractors in the template (e.g. ‘{{ extraction(“my_extractor”) }}'); if the default value of ‘false’ is used, extractors will simply be available by their name (e.g. ‘{{ my_extractor }}').
extractors []envoy.api.v2.filter.http.TransformationTemplate.ExtractorsEntry repeated Use this attribute to extract information from the request. It consists of a map of strings to extractors. The extractor will defines which information will be extracted, while the string key will provide the extractor with a name. You can reference extractors by their name in templates, e.g. “{{ my-extractor }}” will render to the value of the “my-extractor” extractor.
headers []envoy.api.v2.filter.http.TransformationTemplate.HeadersEntry repeated Use this attribute to transform request/response headers. It consists of a map of strings to templates. The string key determines the name of the resulting header, the rendered template will determine the value. Any existing headers with the same header name will be replaced by the transformed header. If a header name is included in headers and headers_to_append, it will first be replaced the template in headers, then additional header values will be appended by the templates defined in headers_to_append.
headersToAppend []envoy.api.v2.filter.http.TransformationTemplate.HeaderToAppend repeated Use this attribute to transform request/response headers. It consists of an array of string/template objects. Use this attribute to define multiple templates for a single header. Header template(s) defined here will be appended to any existing headers with the same header name, not replace existing ones.
body envoy.api.v2.filter.http.InjaTemplate Apply a template to the body
passthrough envoy.api.v2.filter.http.Passthrough This will cause the transformation filter not to buffer the body. Use this setting if the response body is large and you don't need to transform nor extract information from it.
mergeExtractorsToBody envoy.api.v2.filter.http.MergeExtractorsToBody Merge all defined extractors to the request/response body. If you want to nest elements inside the body, use dot separator in the extractor name.
parseBodyBehavior envoy.api.v2.filter.http.TransformationTemplate.RequestBodyParse
ignoreErrorOnParse bool If set to true, Envoy will not throw an exception in case the body parsing fails.
dynamicMetadataValues []envoy.api.v2.filter.http.TransformationTemplate.DynamicMetadataValue repeated Use this field to set Dynamic Metadata.

TransformationTemplate.DynamicMetadataValue

Field Type Label Description
metadataNamespace string The metadata namespace. Defaults to the filter namespace.
key string The metadata key.
value envoy.api.v2.filter.http.InjaTemplate A template that determines the metadata value.

TransformationTemplate.ExtractorsEntry

Field Type Label Description
key string
value envoy.api.v2.filter.http.Extraction

TransformationTemplate.HeaderToAppend

Field Type Label Description
key string Header name
value envoy.api.v2.filter.http.InjaTemplate Apply a template to the header value

TransformationTemplate.HeadersEntry

Field Type Label Description
key string
value envoy.api.v2.filter.http.InjaTemplate

TransformationTemplate.RequestBodyParse

Name Number Description
ParseAsJson 0 Will attempt to parse the request/response body as JSON
DontParse 1 The request/response body will be treated as plain text