diff --git a/biscuit-auth/examples/testcases.rs b/biscuit-auth/examples/testcases.rs index 70266dff..9d06d196 100644 --- a/biscuit-auth/examples/testcases.rs +++ b/biscuit-auth/examples/testcases.rs @@ -2158,6 +2158,7 @@ fn typeof_op(target: &str, root: &KeyPair, test: bool) -> TestResult { check if [true, false].type() == "set"; set([true, false]); check if set($t), $t.type() == "set"; + check if null.type() == "null"; null(null); check if null($t), $t.type() == "null"; "# diff --git a/biscuit-auth/samples/README.md b/biscuit-auth/samples/README.md index f5e8b6de..a7c7cf18 100644 --- a/biscuit-auth/samples/README.md +++ b/biscuit-auth/samples/README.md @@ -2897,6 +2897,7 @@ check if true.type() == "bool"; check if bool($t), $t.type() == "bool"; check if [false, true].type() == "set"; check if set($t), $t.type() == "set"; +check if null.type() == "null"; check if null($t), $t.type() == "null"; ``` @@ -2908,7 +2909,7 @@ allow if true; ``` revocation ids: -- `388798e8ccb432572e6eb3dc8d0ca0501245597a44a605209f6f7571cae39f21a55edad33b55c4ec660be18f2141b75e7aabbfc0c7ff6461f12e80e1dc7b4d0a` +- `1d9153b1a5fd0a5ac4ba0c8c524850c9b94833574643bcfdb072de7a67a759c4bd92ef83710f22775a791409340468f3be00d882f43d837a2aafb10f376a440b` authorizer world: ``` @@ -2948,6 +2949,7 @@ World { "check if hex:aa.type() == \"bytes\"", "check if integer($t), $t.type() == \"integer\"", "check if null($t), $t.type() == \"null\"", + "check if null.type() == \"null\"", "check if set($t), $t.type() == \"set\"", "check if string($t), $t.type() == \"string\"", "check if true.type() == \"bool\"", diff --git a/biscuit-auth/samples/samples.json b/biscuit-auth/samples/samples.json index e62fa776..10f600e5 100644 --- a/biscuit-auth/samples/samples.json +++ b/biscuit-auth/samples/samples.json @@ -2708,7 +2708,7 @@ ], "public_keys": [], "external_key": null, - "code": "integer(1);\nstring(\"test\");\ndate(2023-12-28T00:00:00Z);\nbytes(hex:aa);\nbool(true);\nset([false, true]);\nnull(null);\ncheck if 1.type() == \"integer\";\ncheck if integer($t), $t.type() == \"integer\";\ncheck if \"test\".type() == \"string\";\ncheck if string($t), $t.type() == \"string\";\ncheck if (2023-12-28T00:00:00Z).type() == \"date\";\ncheck if date($t), $t.type() == \"date\";\ncheck if hex:aa.type() == \"bytes\";\ncheck if bytes($t), $t.type() == \"bytes\";\ncheck if true.type() == \"bool\";\ncheck if bool($t), $t.type() == \"bool\";\ncheck if [false, true].type() == \"set\";\ncheck if set($t), $t.type() == \"set\";\ncheck if null($t), $t.type() == \"null\";\n" + "code": "integer(1);\nstring(\"test\");\ndate(2023-12-28T00:00:00Z);\nbytes(hex:aa);\nbool(true);\nset([false, true]);\nnull(null);\ncheck if 1.type() == \"integer\";\ncheck if integer($t), $t.type() == \"integer\";\ncheck if \"test\".type() == \"string\";\ncheck if string($t), $t.type() == \"string\";\ncheck if (2023-12-28T00:00:00Z).type() == \"date\";\ncheck if date($t), $t.type() == \"date\";\ncheck if hex:aa.type() == \"bytes\";\ncheck if bytes($t), $t.type() == \"bytes\";\ncheck if true.type() == \"bool\";\ncheck if bool($t), $t.type() == \"bool\";\ncheck if [false, true].type() == \"set\";\ncheck if set($t), $t.type() == \"set\";\ncheck if null.type() == \"null\";\ncheck if null($t), $t.type() == \"null\";\n" } ], "validations": { @@ -2745,6 +2745,7 @@ "check if hex:aa.type() == \"bytes\"", "check if integer($t), $t.type() == \"integer\"", "check if null($t), $t.type() == \"null\"", + "check if null.type() == \"null\"", "check if set($t), $t.type() == \"set\"", "check if string($t), $t.type() == \"string\"", "check if true.type() == \"bool\"" @@ -2760,7 +2761,7 @@ }, "authorizer_code": "allow if true;\n", "revocation_ids": [ - "388798e8ccb432572e6eb3dc8d0ca0501245597a44a605209f6f7571cae39f21a55edad33b55c4ec660be18f2141b75e7aabbfc0c7ff6461f12e80e1dc7b4d0a" + "1d9153b1a5fd0a5ac4ba0c8c524850c9b94833574643bcfdb072de7a67a759c4bd92ef83710f22775a791409340468f3be00d882f43d837a2aafb10f376a440b" ] } } diff --git a/biscuit-auth/samples/test033_typeof.bc b/biscuit-auth/samples/test033_typeof.bc index 29febd1a..e4f86354 100644 Binary files a/biscuit-auth/samples/test033_typeof.bc and b/biscuit-auth/samples/test033_typeof.bc differ