Support ListValue for metadata matcher (#3964)
Signed-off-by: Limin Wang <liminwang@google.com> Mirrored from https://github.com/envoyproxy/envoy @ 3868326bd7ac57e01815577c944876ee5cd76087pull/620/head
parent
d0d907d784
commit
d56bdcb1fc
3 changed files with 89 additions and 46 deletions
@ -0,0 +1,58 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.type.matcher; |
||||||
|
option go_package = "matcher"; |
||||||
|
|
||||||
|
import "envoy/type/matcher/number.proto"; |
||||||
|
import "envoy/type/matcher/string.proto"; |
||||||
|
|
||||||
|
import "validate/validate.proto"; |
||||||
|
|
||||||
|
// [#protodoc-title: ValueMatcher] |
||||||
|
|
||||||
|
// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported. |
||||||
|
// StructValue is not supported and is always not matched. |
||||||
|
message ValueMatcher { |
||||||
|
// NullMatch is an empty message to specify a null value. |
||||||
|
message NullMatch { |
||||||
|
} |
||||||
|
|
||||||
|
// Specifies how to match a value. |
||||||
|
oneof match_pattern { |
||||||
|
option (validate.required) = true; |
||||||
|
|
||||||
|
// If specified, a match occurs if and only if the target value is a NullValue. |
||||||
|
NullMatch null_match = 1; |
||||||
|
|
||||||
|
// If specified, a match occurs if and only if the target value is a double value and is |
||||||
|
// matched to this field. |
||||||
|
DoubleMatcher double_match = 2; |
||||||
|
|
||||||
|
// If specified, a match occurs if and only if the target value is a string value and is |
||||||
|
// matched to this field. |
||||||
|
StringMatcher string_match = 3; |
||||||
|
|
||||||
|
// If specified, a match occurs if and only if the target value is a bool value and is equal |
||||||
|
// to this field. |
||||||
|
bool bool_match = 4; |
||||||
|
|
||||||
|
// If specified, value match will be performed based on whether the path is referring to a |
||||||
|
// valid primitive value in the metadata. If the path is referring to a non-primitive value, |
||||||
|
// the result is always not matched. |
||||||
|
bool present_match = 5; |
||||||
|
|
||||||
|
// If specified, a match occurs if and only if the target value is a list value and |
||||||
|
// is matched to this field. |
||||||
|
ListMatcher list_match = 6; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// Specifies the way to match a list value. |
||||||
|
message ListMatcher { |
||||||
|
oneof match_pattern { |
||||||
|
option (validate.required) = true; |
||||||
|
|
||||||
|
// If specified, at least one of the values in the list must match the value specified. |
||||||
|
ValueMatcher one_of = 1; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue