Path Transformations API

PathTransformation defines an API to apply a sequence of operations that can be used to alter text before it is used for matching or routing. Multiple actions can be applied in the same Transformation, forming a sequential pipeline. The transformations will be performed in the order that they appear.

This API is a work in progress.

type.http.v3.PathTransformation

[type.http.v3.PathTransformation proto]

  1. {
  2. "operations": []
  3. }

operations

(repeated type.http.v3.PathTransformation.Operation) A list of operations to apply. Transformations will be performed in the order that they appear.

type.http.v3.PathTransformation.Operation

[type.http.v3.PathTransformation.Operation proto]

A type of operation to alter text.

  1. {
  2. "normalize_path_rfc_3986": "{...}",
  3. "merge_slashes": "{...}"
  4. }

normalize_path_rfc_3986

(type.http.v3.PathTransformation.Operation.NormalizePathRFC3986) Enable path normalization per RFC 3986.

Precisely one of normalize_path_rfc_3986, merge_slashes must be set.

merge_slashes

(type.http.v3.PathTransformation.Operation.MergeSlashes) Enable merging adjacent slashes.

Precisely one of normalize_path_rfc_3986, merge_slashes must be set.

type.http.v3.PathTransformation.Operation.NormalizePathRFC3986

[type.http.v3.PathTransformation.Operation.NormalizePathRFC3986 proto]

Should text be normalized according to RFC 3986? This typically is used for path headers before any processing of requests by HTTP filters or routing. This applies percent-encoded normalization and path segment normalization. Fails on characters disallowed in URLs (e.g. NULLs). See Normalization and Comparison for details of normalization. Note that this options does not perform case normalization

type.http.v3.PathTransformation.Operation.MergeSlashes

[type.http.v3.PathTransformation.Operation.MergeSlashes proto]

Determines if adjacent slashes are merged into one. A common use case is for a request path header. Using this option in :ref: PathNormalizationOptions <envoy_v3_api_msg_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions> will allow incoming requests with path //dir///file to match against route with prefix match set to /dir. When using for header transformations, note that slash merging is not part of HTTP spec and is provided for convenience.