You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change is large enough it can't be addressed with a simple Pull Request
Change
Summary of the proposed change and some details about what problem
it helps solve.
We make use of "Any" protos for several api's where the list of expected/possible types is known a priori. A key example of this is googles LongRunning service and associated rpcs. Today we are unable to inform the cel env that while the type of the any can vary it should only vary among a subset of possible types (which lets some bad filters execute, for example comparing ints to strings in the underlying message)
Example
This may currently be possible (and I'm just uninformed) but we'd like to be able to tell the cel environment something akin to
This is actually really hard to do within CEL; however, you could have a base environment which you extend M times (once per Any) which declares the variable with a concrete type. Effectively if any of the M environments compiles the expression without a failure, then it's a valid expression. Very hacky and not very fun to implement, but it would work.
That would work for parse/check but for Eval that would end up failing due to the types not matching right?
effectively something like
varpossibleEnvs:=map[type]cel.Env{}
//parse/check against both `Any` and `Concrete`ast, issues:=possibleEnvs[Any].Compile()
...
_, issues:=possibleEnvs[Concrete].Compile()
//if either have issues returnpossibleEnvs[Any].Program(ast)
...
Feature request checklist
Change
Summary of the proposed change and some details about what problem
it helps solve.
We make use of "Any" protos for several api's where the list of expected/possible types is known a priori. A key example of this is googles LongRunning service and associated rpcs. Today we are unable to inform the cel env that while the type of the any can vary it should only vary among a subset of possible types (which lets some bad filters execute, for example comparing ints to strings in the underlying message)
Example
This may currently be possible (and I'm just uninformed) but we'd like to be able to tell the cel environment something akin to
Alternatives considered
None
The text was updated successfully, but these errors were encountered: