Giter Site home page Giter Site logo

Comments (3)

TristonianJones avatar TristonianJones commented on July 29, 2024 1

Hi David,

You are always welcome to reach out to [email protected], especially if there's some of the Go code involved.

The short answer to your question is that evaluation over protos which are not linked into the environment and added as cel.Types (or cel.TypeDescs) will result in an error. Generally the evaluation library is embedded in the binary where the evaluation occurs, but the parse / check can remain separate. For example, you could parse / check via gRPC, but evaluate the result with https://github.com/google/cel-cpp or https://github.com/google/cel-go.

However, you should be able build a JSON object in CEL with a top-level @type set to proper type url and get the protobuf.Any unpack methods to properly deserialize the JSON to a protobuf known to your environment.

Hope that helps,

-Tristan

from cel-spec.

drx777 avatar drx777 commented on July 29, 2024

Thank you for your response and explanation. The problem is I'm in Java/Kotlin code here, so using the go library is not a possibility. I would have to make the protobuf definitions known to the CEL service, which somewhat defies the purpose of a general evaluation service. Still, thank you for the clarification.
Feel free to close the issue.

from cel-spec.

TristonianJones avatar TristonianJones commented on July 29, 2024

Here are a few things to consider:

  • There is a chance we will open source a Java version of CEL.
  • The JSON trick I mentioned will make the object compatible with Any deserialization, and might work for you.
  • The conformance service was really only meant for handling a uniform set of test cases, and Go in particular doesn't support dynamic proto construction like some of the other proto implementations do. However, if you know the set of proto message types, you can modify the service and register the types in Go.

from cel-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.