transformation.proto

Package: envoy.api.v2.filter.http

Types:

Source File: github.com/solo-io/gloo/projects/gloo/api/external/envoy/extensions/transformation/transformation.proto

FilterTransformations

"transformations": []envoy.api.v2.filter.http.TransformationRule
"stage": int

Field Type Description Default
transformations []envoy.api.v2.filter.http.TransformationRule 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 int Only RouteTransformations.RouteTransformation with matching stage will be used with this filter.

TransformationRule

"match": .envoy.config.route.v3.RouteMatch
"routeTransformations": .envoy.api.v2.filter.http.TransformationRule.Transformations

Field Type Description Default
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.

Transformations

"requestTransformation": .envoy.api.v2.filter.http.Transformation
"clearRouteCache": bool
"responseTransformation": .envoy.api.v2.filter.http.Transformation

Field Type Description Default
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.

RouteTransformations

"requestTransformation": .envoy.api.v2.filter.http.Transformation
"responseTransformation": .envoy.api.v2.filter.http.Transformation
"clearRouteCache": bool
"transformations": []envoy.api.v2.filter.http.RouteTransformations.RouteTransformation

Field Type Description Default
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

RouteTransformation

"stage": int
"requestMatch": .envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.RequestMatch
"responseMatch": .envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.ResponseMatch

Field Type Description Default
stage int Stage number. This transformation will only be processed by filters with the same stage number.
requestMatch .envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.RequestMatch Only one of requestMatch or responseMatch can be set.
responseMatch .envoy.api.v2.filter.http.RouteTransformations.RouteTransformation.ResponseMatch Only one of responseMatch or requestMatch can be set.

RequestMatch

"match": .envoy.config.route.v3.RouteMatch
"requestTransformation": .envoy.api.v2.filter.http.Transformation
"responseTransformation": .envoy.api.v2.filter.http.Transformation
"clearRouteCache": bool

Field Type Description Default
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.

ResponseMatch

"match": .envoy.api.v2.filter.http.ResponseMatcher
"responseTransformation": .envoy.api.v2.filter.http.Transformation

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

ResponseMatcher

"headers": []envoy.config.route.v3.HeaderMatcher
"responseCodeDetails": .envoy.type.matcher.v3.StringMatcher

Field Type Description Default
headers []envoy.config.route.v3.HeaderMatcher 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

"match": .envoy.api.v2.filter.http.ResponseMatcher
"responseTransformation": .envoy.api.v2.filter.http.Transformation

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

Transformation

This message defines a transformation.

"transformationTemplate": .envoy.api.v2.filter.http.TransformationTemplate
"headerBodyTransform": .envoy.api.v2.filter.http.HeaderBodyTransform

Field Type Description Default
transformationTemplate .envoy.api.v2.filter.http.TransformationTemplate Apply transformation templates. Only one of transformationTemplate or headerBodyTransform can be set.
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. Only one of headerBodyTransform or transformationTemplate can be set.

Extraction

Extractions can be used to extract information from the request/response. The extracted information can then be referenced in template fields.

"header": string
"body": .google.protobuf.Empty
"regex": string
"subgroup": int

Field Type Description Default
header string Extract information from headers. Only one of header or body can be set.
body .google.protobuf.Empty Extract information from the request/response body. Only one of body or header can be set.
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 int If your regex contains capturing groups, use this field to determine which group should be selected.

TransformationTemplate

Defines a transformation template.

"advancedTemplates": bool
"extractors": map<string, .envoy.api.v2.filter.http.Extraction>
"headers": map<string, .envoy.api.v2.filter.http.InjaTemplate>
"body": .envoy.api.v2.filter.http.InjaTemplate
"passthrough": .envoy.api.v2.filter.http.Passthrough
"mergeExtractorsToBody": .envoy.api.v2.filter.http.MergeExtractorsToBody
"parseBodyBehavior": .envoy.api.v2.filter.http.TransformationTemplate.RequestBodyParse
"ignoreErrorOnParse": bool
"dynamicMetadataValues": []envoy.api.v2.filter.http.TransformationTemplate.DynamicMetadataValue

Field Type Description Default
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 map<string, .envoy.api.v2.filter.http.Extraction> 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 map<string, .envoy.api.v2.filter.http.InjaTemplate> 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.
body .envoy.api.v2.filter.http.InjaTemplate Apply a template to the body. Only one of body, or mergeExtractorsToBody can be set.
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. Only one of passthrough, or mergeExtractorsToBody can be set.
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. Only one of mergeExtractorsToBody, or passthrough can be set.
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 Use this field to set Dynamic Metadata.

DynamicMetadataValue

Defines an Envoy Dynamic Metadata entry.

"metadataNamespace": string
"key": string
"value": .envoy.api.v2.filter.http.InjaTemplate

Field Type Description Default
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.

RequestBodyParse

Determines how the body will be parsed.

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

InjaTemplate

Defines an Inja template that will be rendered by Gloo. In addition to the core template functions, the Gloo transformation filter defines the following custom functions:

"text": string

Field Type Description Default
text string

Passthrough


Field Type Description Default

MergeExtractorsToBody


Field Type Description Default

HeaderBodyTransform


Field Type Description Default