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)
| 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. |
| 231 | func ValidateComprehensionNestingLimit(limit int) ASTValidator { |
| 232 | return nestingLimitValidator{limit: limit} |
| 233 | } |
| 234 | |
| 235 | type argChecker func(env *Env, call, arg ast.Expr) error |
| 236 |
no outgoing calls