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
Change
To make CEL environment setup consistent across CEL implementations, I propose to add a runtime option equivalent to CEL-cpp InterpreterOptions.enable_comprehension to CEL-Go and CEL-Java (corresponding ticket google/cel-java#484).
In Java, runtime CEL comprehensions can be limited using comprehensionMaxIterations(int value) runtime option. Setting value to 0 disables the comprehension macros. If the limit is reached, program evaluation throws CelEvaluationException with CelErrorCode.ITERATION_BUDGET_EXCEEDED.
There is no option equivalent to comprehensionMaxIterations() in CEL-Go . Similar to google/cel-java#484, the new Go option equivalent to cpp's enable_comprehension could use comprehensionMaxIterations(0) under-the-hood.
Example
// Actual option names up to the implementer.prg, err:=env.Program(ast, EvalOptions(OptDisableComprehension))
// Equivalent:prg, err:=env.Program(ast, ComprehensionMaxIterations(0))
Related
Internal ref: go/grpc-cel-integration
The text was updated successfully, but these errors were encountered:
sergiitk
changed the title
Support runtime options to limit or disable comprehension macros
Support runtime options to limit and disable comprehension macros
Oct 24, 2024
sergiitk
changed the title
Support runtime options to limit and disable comprehension macros
Support ProgramOptions to limit and disable comprehension macros
Nov 25, 2024
Feature request checklist
Change
To make CEL environment setup consistent across CEL implementations, I propose to add a runtime option equivalent to CEL-cpp
InterpreterOptions.enable_comprehension
to CEL-Go and CEL-Java (corresponding ticket google/cel-java#484).In Java, runtime CEL comprehensions can be limited using
comprehensionMaxIterations(int value)
runtime option. Settingvalue
to 0 disables the comprehension macros. If the limit is reached, program evaluation throwsCelEvaluationException
withCelErrorCode.ITERATION_BUDGET_EXCEEDED
.There is no option equivalent to
comprehensionMaxIterations()
in CEL-Go . Similar to google/cel-java#484, the new Go option equivalent to cpp'senable_comprehension
could usecomprehensionMaxIterations(0)
under-the-hood.Example
Related
Internal ref: go/grpc-cel-integration
The text was updated successfully, but these errors were encountered: