Skip to content

cel: add raw string expression support #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged

Conversation

wbpcode
Copy link
Contributor

@wbpcode wbpcode commented Mar 26, 2025

No description provided.

Signed-off-by: wangbaiping(wbpcode) <wangbaiping@bytedance.com>

// Unparsed expression in string form.
//
// If set, takes precedence over ``cel_expr_parsed`` and ``cel_expr_checked``.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a description or link to what is a valid string value that is expected here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example and the spec link is added.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I'm going to approve this for now, but it's not clear to me where is "request.headers" defined? Is there a "response.body"?
I would assume this is all written somewhere (doc), and there should be a link here to that doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most CEL attributes are host-dependent. That's say, the example requires the host to support request.headers attributes. And you can see all attributes supported by envoy at here: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess that's the link that could've been added here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sure because xds repo is also be used by other projects. So, I only put an example and spec link here.

Signed-off-by: wangbaiping(wbpcode) <wangbaiping@bytedance.com>

// Unparsed expression in string form.
//
// If set, takes precedence over ``cel_expr_parsed`` and ``cel_expr_checked``.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I'm going to approve this for now, but it's not clear to me where is "request.headers" defined? Is there a "response.body"?
I would assume this is all written somewhere (doc), and there should be a link here to that doc.

@adisuissa adisuissa merged commit ae57f3c into cncf:main Mar 26, 2025
4 checks passed
@markdroth
Copy link
Contributor

What's the motivation for this?

In general, I don't think we want to support sending raw CEL expressions to the data plane. It makes more sense for the control plane to pre-compile the expression before sending it to the data plane, for both performance and validation reasons.

Also, note that gRPC C++ will basically never be able to support this, because CEL C++ depends on protobuf, and gRPC can't take a dependency on protobuf internally.

@adisuissa
Copy link

What's the motivation for this?

Here's the context:
#115 (comment)

In general, I don't think we want to support sending raw CEL expressions to the data plane. It makes more sense for the control plane to pre-compile the expression before sending it to the data plane, for both performance and validation reasons.

I think this should be called out in the field's comments, highlighting the benefits of using the other fields.

@wbpcode wbpcode deleted the dev-cel-string branch March 27, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants