Skip to content

Commit

Permalink
Fixes per review: CEL matcher name, CelExtractString package
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Tkachenko <sergiitk@google.com>
  • Loading branch information
sergiitk committed May 13, 2022
1 parent ddda424 commit dfb64cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
26 changes: 2 additions & 24 deletions xds/type/matcher/v3/cel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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
// <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;
}
21 changes: 21 additions & 0 deletions xds/type/v3/cel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -31,3 +32,23 @@ message CelExpression {
google.api.expr.v1alpha1.CheckedExpr checked_expr = 2;
}
}

// 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.
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;
}

0 comments on commit dfb64cd

Please sign in to comment.