Commit 414aba3
Refuse on a deny rule that never answers the question
`matches` read the result of an expression as `evaluate(...) === true`, so a rule
that parsed and evaluated but answered with something other than a boolean was
neither a match nor an error. In the deny list that meant it did not deny, and the
permissive `allow: ["true"]` that ships by default then let the action through.
`deny: ["Submit order"]` is the way in. It is what somebody writes who reads the
list as labels rather than expressions, and it is a valid CEL string, so it
evaluates to "Submit order", falls out of the deny loop, and the Bot clicks the
button. Nothing was logged, because only the throwing path logged, and the rule
still sat on the Boundaries page looking as though it were in force. A bare field
reference, a ternary returning a string and a bare number all land the same way.
Treat any non-boolean answer as a broken rule and send it down the existing
fail-closed path, which denies in the deny list, does not permit in the allow list,
and logs either way. False stays a real answer: a deny list that read every false
as a denial would refuse everything.
Checked against every rule the product ships, the .env.example example and the four
Boundaries presets, over contexts with and without an element, a key and a file.
None of them changes verdict.1 parent f725fb5 commit 414aba3
2 files changed
Lines changed: 66 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
197 | 206 | | |
198 | 207 | | |
199 | 208 | | |
200 | | - | |
201 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
202 | 219 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
206 | 223 | | |
| 224 | + | |
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
90 | 133 | | |
91 | 134 | | |
92 | 135 | | |
| |||
0 commit comments