From e544df58ad27ab79f7219c8cc1cbfa053cd36633 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Wed, 20 Nov 2024 14:45:11 +0100 Subject: [PATCH] use strict equals in integer wraparound samples This makes this sample usable with older implementations --- biscuit-auth/examples/testcases.rs | 6 +++--- biscuit-auth/samples/README.md | 14 +++++++------- biscuit-auth/samples/samples.json | 10 +++++----- .../samples/test027_integer_wraparound.bc | Bin 295 -> 293 bytes 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/biscuit-auth/examples/testcases.rs b/biscuit-auth/examples/testcases.rs index 30a42fcc..84745859 100644 --- a/biscuit-auth/examples/testcases.rs +++ b/biscuit-auth/examples/testcases.rs @@ -1936,9 +1936,9 @@ fn integer_wraparound(target: &str, root: &KeyPair, test: bool) -> TestResult { let biscuit = biscuit!( r#" - check if 10000000000 * 10000000000 != 0; - check if 9223372036854775807 + 1 != 0; - check if -9223372036854775808 - 1 != 0; + check if 10000000000 * 10000000000 !== 0; + check if 9223372036854775807 + 1 !== 0; + check if -9223372036854775808 - 1 !== 0; "# ) .build_with_rng(&root, SymbolTable::default(), &mut rng) diff --git a/biscuit-auth/samples/README.md b/biscuit-auth/samples/README.md index 1eea20a9..64c630f5 100644 --- a/biscuit-auth/samples/README.md +++ b/biscuit-auth/samples/README.md @@ -2257,9 +2257,9 @@ symbols: [] public keys: [] ``` -check if 10000000000 * 10000000000 != 0; -check if 9223372036854775807 + 1 != 0; -check if -9223372036854775808 - 1 != 0; +check if 10000000000 * 10000000000 !== 0; +check if 9223372036854775807 + 1 !== 0; +check if -9223372036854775808 - 1 !== 0; ``` ### validation @@ -2270,7 +2270,7 @@ allow if true; ``` revocation ids: -- `846fbe9e7ad3581eada5d33475fb6362e83a526c5d3c7c1c6c063e8dc512485f1ec9f876d9e83d6d335e79b35e7be38b728c1b3583a6d56dd85b104c2e4f4404` +- `fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c` authorizer world: ``` @@ -2283,9 +2283,9 @@ World { 0, ), checks: [ - "check if -9223372036854775808 - 1 != 0", - "check if 10000000000 * 10000000000 != 0", - "check if 9223372036854775807 + 1 != 0", + "check if -9223372036854775808 - 1 !== 0", + "check if 10000000000 * 10000000000 !== 0", + "check if 9223372036854775807 + 1 !== 0", ], }, ] diff --git a/biscuit-auth/samples/samples.json b/biscuit-auth/samples/samples.json index 69586378..f52dd5e2 100644 --- a/biscuit-auth/samples/samples.json +++ b/biscuit-auth/samples/samples.json @@ -2103,7 +2103,7 @@ "symbols": [], "public_keys": [], "external_key": null, - "code": "check if 10000000000 * 10000000000 != 0;\ncheck if 9223372036854775807 + 1 != 0;\ncheck if -9223372036854775808 - 1 != 0;\n" + "code": "check if 10000000000 * 10000000000 !== 0;\ncheck if 9223372036854775807 + 1 !== 0;\ncheck if -9223372036854775808 - 1 !== 0;\n" } ], "validations": { @@ -2115,9 +2115,9 @@ { "origin": 0, "checks": [ - "check if -9223372036854775808 - 1 != 0", - "check if 10000000000 * 10000000000 != 0", - "check if 9223372036854775807 + 1 != 0" + "check if -9223372036854775808 - 1 !== 0", + "check if 10000000000 * 10000000000 !== 0", + "check if 9223372036854775807 + 1 !== 0" ] } ], @@ -2132,7 +2132,7 @@ }, "authorizer_code": "allow if true;\n", "revocation_ids": [ - "846fbe9e7ad3581eada5d33475fb6362e83a526c5d3c7c1c6c063e8dc512485f1ec9f876d9e83d6d335e79b35e7be38b728c1b3583a6d56dd85b104c2e4f4404" + "fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c" ] } } diff --git a/biscuit-auth/samples/test027_integer_wraparound.bc b/biscuit-auth/samples/test027_integer_wraparound.bc index 5457892a48d6ab959b6584960432b231daa00c6d..463a6c53b3901de38033590779d3ae94969654af 100644 GIT binary patch delta 100 zcmZ3^w3LZM=pQ53WJU>=i5&WjA`>k@M1}#7n5p6LJFe=`?oR!fProD6Ykpn)nfq$@ ziH8x7|4PR_KeBDgoSE|!GbL*FJ++=<_xjeY^%>3T?z>i;|E2%)dxPr2ukkKClbIP+ E06;)4#{d8T delta 102 zcmZ3=w48}UsDX)VGNT0BL=JsMv56KSBEtYk%+zpd$=^4x>T-nK+NGCGN`EIOy|4<( ziM6Sb$zikWJu2i8FL&}s+07TWxyEsoo8zhH`IntLN!z(>#Dg++sLG9#l3 E02p*7iU0rr