diff --git a/xds/type/matcher/v3/cel.proto b/xds/type/matcher/v3/cel.proto index 55678a46..00f6ca0b 100644 --- a/xds/type/matcher/v3/cel.proto +++ b/xds/type/matcher/v3/cel.proto @@ -5,12 +5,10 @@ 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_outer_classname = "CelProto"; option java_multiple_files = true; option go_package = "github.com/cncf/xds/go/xds/type/matcher/v3"; @@ -34,27 +32,7 @@ option (xds.annotations.v3.file_status).work_in_progress = true; // // [#comment:TODO(sergiitk): Link HttpAttributesMatchInput + usage example.] // [#comment:TODO(sergiitk): Add extension category.] -message CelBoolMatcher { +message CelMatcher { // 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 -// `_ (CEL) expression against the standardized set of -// :ref:`HTTP 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; -} diff --git a/xds/type/v3/cel.proto b/xds/type/v3/cel.proto index c574e12f..a4f6b037 100644 --- a/xds/type/v3/cel.proto +++ b/xds/type/v3/cel.proto @@ -4,6 +4,7 @@ package xds.type.v3; import "google/api/expr/v1alpha1/checked.proto"; import "google/api/expr/v1alpha1/syntax.proto"; +import "google/protobuf/wrappers.proto"; import "xds/annotations/v3/status.proto"; @@ -31,3 +32,23 @@ message CelExpression { google.api.expr.v1alpha1.CheckedExpr checked_expr = 2; } } + +// Extracts a string by evaluating a `Common Expression Language +// `_ (CEL) expression against the standardized set of +// :ref:`HTTP 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. + 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; +}