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

Function ValidateComprehensionNestingLimit

cel/validator.go:247–249  ·  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

245// no actual looping cost. The cel.bind() utilizes the comprehension structure to perform local variable
246// assignments and supplies an empty iteration range, so they won't count against the nesting limit either.
247func ValidateComprehensionNestingLimit(limit int) ASTValidator {
248 return nestingLimitValidator{limit: limit}
249}
250
251// ValidateBindNestingLimit ensures that cel.bind() macro nesting does not exceed the specified limit.
252//

Callers 6

validator.goFile · 0.85
TestOverrideValidatorFunction · 0.85
TestEnvToConfigFunction · 0.85

Calls

no outgoing calls