MCPcopy Create free account
hub / github.com/cel-expr/cel-go / ValidateComprehensionNestingLimit

Function ValidateComprehensionNestingLimit

cel/validator.go:231–233  ·  view source on GitHub ↗

ValidateComprehensionNestingLimit ensures that comprehension nesting does not exceed the specified limit. This validator can be useful for preventing arbitrarily nested comprehensions which can take high polynomial time to complete. Note, this limit does not apply to comprehensions with an empty i

(limit int)

Source from the content-addressed store, hash-verified

229// no actual looping cost. The cel.bind() utilizes the comprehension structure to perform local variable
230// assignments and supplies an empty iteration range, so they won't count against the nesting limit either.
231func ValidateComprehensionNestingLimit(limit int) ASTValidator {
232 return nestingLimitValidator{limit: limit}
233}
234
235type argChecker func(env *Env, call, arg ast.Expr) error
236

Callers 3

validator.goFile · 0.85
TestEnvToConfigFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestEnvToConfigFunction · 0.68