value matcher: add OR matcher (#30336)

Commit Message: Extend matcher to support alternatives.
Additional Description: JWT claims allow optional lists, e.g. `"x"` and `["x"]` are allowed for `aud` claim. When used for routing using dynamic metadata ([here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-msg-config-route-v3-routematch)), we cannot express a way to match either of these options.
Risk Level: low
Testing: done
Docs Changes: none
Release Notes: none (minor feature)
Issues: #29681
Signed-off-by: Kuat Yessenov <kuat@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ a98cafb715cb6d40f50a8330b709e05011fd6919
main
update-envoy[bot] 1 year ago
parent 4657366b4d
commit 844f9e8f65
  1. 10
      envoy/type/matcher/v3/value.proto

@ -19,7 +19,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported.
// StructValue is not supported and is always not matched.
// [#next-free-field: 7]
// [#next-free-field: 8]
message ValueMatcher {
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.ValueMatcher";
@ -56,6 +56,9 @@ message ValueMatcher {
// 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;
// If specified, a match occurs if and only if any of the alternatives in the match accept the value.
OrMatcher or_match = 7;
}
}
@ -70,3 +73,8 @@ message ListMatcher {
ValueMatcher one_of = 1;
}
}
// Specifies a list of alternatives for the match.
message OrMatcher {
repeated ValueMatcher value_matchers = 1 [(validate.rules).repeated = {min_items: 2}];
}

Loading…
Cancel
Save