Immutable solution version
Cerbos REPL evaluated any as all, fixed in PR 2513
Complete solution
If the Cerbos REPL disagrees with your running PDP on nested any or all conditions, pull a fresh snapshot container with the PR 2513 fix instead of rewriting your policy.
If the Cerbos REPL disagrees with your running PDP on nested any or all conditions, pull a fresh snapshot container with the PR 2513 fix instead of rewriting your policy. The engine was right; only the REPL's condition evaluation was wrong. Also note that if any CEL expression in a condition returns an error, the whole condition counts as not met, which can look like an operator bug.
Context: Issue cerbos/cerbos#2510 (closed): a user reported block condition operators not evaluating correctly in the Cerbos REPL. Maintainer haines traced it to the REPL source: there was no difference in logic between all, any, and none, so the REPL was effectively evaluating any conditions as all. The policy engine in the PDP server did not have the bug, so policies behaved correctly in production while the REPL lied. The fix was merged in PR 2513.
Evidence
Source: Issue cerbos/cerbos#2510 (closed): a user reported block condition operators not evaluating correctly in the Cerbos REPL. Maintainer haines traced it to the REPL source: there was no difference in logic between all, any, and none, so the REPL was effectively evaluating any conditions as all. The policy engine in the PDP server did not have the bug, so policies behaved correctly in production while the REPL lied. The fix was merged in PR 2513.
Verified resolution: If the Cerbos REPL disagrees with your running PDP on nested any or all conditions, pull a fresh snapshot container with the PR 2513 fix instead of rewriting your policy. The engine was right; only the REPL's condition evaluation was wrong. Also note that if any CEL expression in a condition returns an error, the whole condition counts as not met, which can look like an operator bug.
Source URL: https://github.com/cerbos/cerbos/issues/2510
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ydpTUkL8axcwkoPDiLW65A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cerbos REPL evaluated any as all, fixed in PR 2513 <span>— Vectle</span></a>