@highflame/policy 2.2.43 → 2.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/condition-groups.js +7 -5
- package/package.json +1 -1
package/dist/condition-groups.js
CHANGED
|
@@ -251,11 +251,13 @@ export function expressionToCedar(expr, optionalFields) {
|
|
|
251
251
|
.join(' || ');
|
|
252
252
|
}
|
|
253
253
|
case 'not': {
|
|
254
|
-
|
|
255
|
-
//
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
// Always parenthesized. `!` binds tighter than every operator a
|
|
255
|
+
// leaf renders with, so dropping the parens re-associates the
|
|
256
|
+
// expression: `!context.score > 70` is `(!context.score) > 70`,
|
|
257
|
+
// which the Cedar validator rejects as "expected Bool but saw
|
|
258
|
+
// Long", and `!context has x` is `(!context) has x`. A leaf is not
|
|
259
|
+
// an atom.
|
|
260
|
+
return `!(${expressionToCedar(expr.child, optionalFields)})`;
|
|
259
261
|
}
|
|
260
262
|
case 'raw': {
|
|
261
263
|
if (isValidRawCondition(expr.text)) {
|