json to metadata content type regex match (#32774)

There is a case when somebody is uploading a file with "content type: multipart/form-data; boundary=------------------------75b5d728d1539bb5"; since the header value will change every time, we can not write a config to allow it in previous proto. Then we need a regex match to allow it.

Risk Level: low
Testing: unit test

Signed-off-by: Cai Qi <cqi@pinterest.com>

Mirrored from https://github.com/envoyproxy/envoy @ 667e96312130ac2bcbb7c1c598f4d63746d6f0c4
main
update-envoy[bot] 1 year ago
parent 2a8f86c009
commit ffaaa978e0
  1. 5
      envoy/extensions/filters/http/json_to_metadata/v3/BUILD
  2. 6
      envoy/extensions/filters/http/json_to_metadata/v3/json_to_metadata.proto

@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_xds//udpa/annotations:pkg"],
deps = [
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_xds//udpa/annotations:pkg",
],
)

@ -2,6 +2,8 @@ syntax = "proto3";
package envoy.extensions.filters.http.json_to_metadata.v3;
import "envoy/type/matcher/v3/regex.proto";
import "google/protobuf/struct.proto";
import "udpa/annotations/status.proto";
@ -108,6 +110,10 @@ message JsonToMetadata {
// Allowed empty content-type for json to metadata transformation.
// Default to false.
bool allow_empty_content_type = 3;
// Allowed content-type by regex match for json to metadata transformation.
// This can be used in parallel with ``allow_content_types``.
type.matcher.v3.RegexMatcher allow_content_types_regex = 4;
}
// At least one of request_rules and response_rules must be provided.

Loading…
Cancel
Save