Skip to content
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

Protobuf extensions #320

Open
rodaine opened this issue Oct 24, 2023 · 2 comments
Open

Protobuf extensions #320

rodaine opened this issue Oct 24, 2023 · 2 comments

Comments

@rodaine
Copy link

rodaine commented Oct 24, 2023

While rare nowadays in general, protobuf extensions are still used to define custom options on descriptors and seem to be one of the first features (re)enabled with editions. The CEL spec doesn't appear to mention one way or another if these fields should be accessible from an expression.

I can see two paths towards supporting proto extensions:

  • User writes a CEL extension function to provide this functionality
  • CEL implementations handle this automatically (either through a builtin-function or through the existing field selection syntax)

Thoughts?

@TristonianJones
Copy link
Collaborator

@rodaine I believe all of the core libraries support protobuf extension accesses; however, we haven't documented this in the spec.

https://github.com/google/cel-go/blob/master/ext/protos.go
https://github.com/google/cel-java/blob/main/extensions/src/main/java/dev/cel/extensions/CelProtoExtensions.java
https://github.com/google/cel-cpp/blob/master/extensions/proto_ext.h

Hopefully this helps you get started!

@rodaine
Copy link
Author

rodaine commented Oct 30, 2023

Thanks! @Alfus pointed me toward the cel-go extension functions shortly after I asked (of course 😅). Do you think it's worth documenting that this is to be handled by functions?

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

No branches or pull requests

3 participants
@TristonianJones @rodaine and others