-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
syntax = "proto3"; | ||
|
||
package xds.type.matcher.v3; | ||
|
||
import "xds/annotations/v3/status.proto"; | ||
import "xds/type/v3/cel.proto"; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
import "validate/validate.proto"; | ||
|
||
option java_package = "com.github.xds.type.matcher.v3"; | ||
option java_outer_classname = "CelMatcherProto"; | ||
option java_multiple_files = true; | ||
option go_package = "github.com/cncf/xds/go/xds/type/matcher/v3"; | ||
|
||
option (xds.annotations.v3.file_status).work_in_progress = true; | ||
|
||
// [#protodoc-title: Common Expression Language (CEL) matchers] | ||
|
||
// Performs a match by evaluating a `Common Expression Language | ||
// <https://github.com/google/cel-spec>`_ (CEL) expression against the standardized set of | ||
// :ref:`HTTP attributes <arch_overview_attributes>` specified via ``HttpAttributesCelMatchInput``. | ||
// | ||
// .. attention:: | ||
// | ||
// The match is ``true``, iff the result of the evaluation is a bool AND true. | ||
// In all other cases, the match is ``false``, including but not limited to: non-bool types, | ||
// ``false``, ``null``,`` int(1)``, etc. | ||
// In case CEL expression raises an error, the result of the evaluation is interpreted "no match". | ||
// | ||
// Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` documentation | ||
// for usage details. | ||
// | ||
// [#comment:TODO(sergiitk): Link HttpAttributesMatchInput + usage example.] | ||
// [#comment:TODO(sergiitk): Add extension category.] | ||
message CelBoolMatcher { | ||
// Either parsed or checked representation of the CEL program. | ||
type.v3.CelExpression expr_match = 1 [(validate.rules).message = {required: true}]; | ||
} | ||
|
||
// Extracts a string by evaluating a `Common Expression Language | ||
// <https://github.com/google/cel-spec>`_ (CEL) expression against the standardized set of | ||
// :ref:`HTTP attributes <arch_overview_attributes>`. | ||
// | ||
// .. attention:: | ||
// | ||
// Besides CEL evaluation raising an error explicitly, CEL program returning a type other than | ||
// the ``string``, or not returning anything, are considered an error as well. | ||
// | ||
// [#comment:TODO(sergiitk): Add extension category.] | ||
message CelExtractString { | ||
// The CEL expression used to extract a string from the CEL environment. | ||
// the "subject string") that should be replaced. | ||
type.v3.CelExpression expr_extract = 1 [(validate.rules).message = {required: true}]; | ||
|
||
// If CEL expression evaluates to an error, this value is be returned to the caller. | ||
// If not set, the error is propagated to the caller. | ||
google.protobuf.StringValue default_value = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters