matching: add support for generic inputs and add environment variable input (#15410)

Adds support for a "generic input" extension point that allows specifying inputs that are not dependent on protocol data.

Adds an environment variable generic input that allows matching on the value of an environment variable.

Signed-off-by: Snow Pettersen <snowp@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 758a9a90c15331fbfd093f23170454c5a2fbf903
pull/624/head
data-plane-api(Azure Pipelines) 4 years ago
parent f8b858fdd2
commit dd8276e9da
  1. 1
      BUILD
  2. 1
      envoy/config/common/matcher/v3/matcher.proto
  3. 1
      envoy/config/common/matcher/v4alpha/matcher.proto
  4. 9
      envoy/extensions/matching/common_inputs/environment_variable/v3/BUILD
  5. 22
      envoy/extensions/matching/common_inputs/environment_variable/v3/input.proto
  6. 1
      versioning/BUILD

@ -246,6 +246,7 @@ proto_library(
"//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg",
"//envoy/extensions/internal_redirect/previous_routes/v3:pkg",
"//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg",
"//envoy/extensions/matching/common_inputs/environment_variable/v3:pkg",
"//envoy/extensions/matching/input_matchers/consistent_hashing/v3:pkg",
"//envoy/extensions/network/socket_interface/v3:pkg",
"//envoy/extensions/rate_limit_descriptors/expr/v3:pkg",

@ -50,6 +50,7 @@ message Matcher {
// Predicate for a single input field.
message SinglePredicate {
// Protocol-specific specification of input field to match on.
// [#extension-category: envoy.matching.common_inputs]
core.v3.TypedExtensionConfig input = 1 [(validate.rules).message = {required: true}];
oneof matcher {

@ -66,6 +66,7 @@ message Matcher {
"envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate";
// Protocol-specific specification of input field to match on.
// [#extension-category: envoy.matching.common_inputs]
core.v4alpha.TypedExtensionConfig input = 1 [(validate.rules).message = {required: true}];
oneof matcher {

@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)

@ -0,0 +1,22 @@
syntax = "proto3";
package envoy.extensions.matching.common_inputs.environment_variable.v3;
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.matching.common_inputs.environment_variable.v3";
option java_outer_classname = "InputProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Environment Variable Input]
// [#extension: envoy.matching.common_inputs.environment_variable]
// Reads an environment variable to provide an input for matching.
message Config {
// Name of the environment variable to read from.
string name = 1 [(validate.rules).string = {min_len: 1}];
}

@ -129,6 +129,7 @@ proto_library(
"//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg",
"//envoy/extensions/internal_redirect/previous_routes/v3:pkg",
"//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg",
"//envoy/extensions/matching/common_inputs/environment_variable/v3:pkg",
"//envoy/extensions/matching/input_matchers/consistent_hashing/v3:pkg",
"//envoy/extensions/network/socket_interface/v3:pkg",
"//envoy/extensions/rate_limit_descriptors/expr/v3:pkg",

Loading…
Cancel
Save