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

Function ValidateComprehensionNestingLimit

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

256// no actual looping cost. The cel.bind() utilizes the comprehension structure to perform local variable
257// assignments and supplies an empty iteration range, so they won't count against the nesting limit either.
258func ValidateComprehensionNestingLimit(limit int) ASTValidator {
259 return nestingLimitValidator{limit: limit}
260}
261
262// ValidateBindNestingLimit ensures that cel.bind() macro nesting does not exceed the specified limit.
263//

Callers 6

validator.goFile · 0.85
TestOverrideValidatorFunction · 0.85
TestEnvToConfigFunction · 0.85

Calls

no outgoing calls