ExpressionUnnestHeight determines the height at which nested expressions are split into local variables within the cel.@block declaration.
(height int)
| 33 | // ExpressionUnnestHeight determines the height at which nested expressions are split into local |
| 34 | // variables within the cel.@block declaration. |
| 35 | func ExpressionUnnestHeight(height int) ComposerOption { |
| 36 | return func(c *RuleComposer) (*RuleComposer, error) { |
| 37 | if height <= 0 { |
| 38 | return nil, fmt.Errorf("invalid unnest height: value must be positive: %d", height) |
| 39 | } |
| 40 | c.exprUnnestHeight = height |
| 41 | return c, nil |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // NewRuleComposer creates a rule composer which stitches together rules within a policy into |
| 46 | // a single CEL expression. |
no outgoing calls