Skip to content

Commit 395435f

Browse files
committed
fix: don’t rely on lists in closures sample
The samples have been designed to map to specific features, in order to help gradual implementation of 3.3 features. The closures are meant to be implemented before lists and maps, so this sample should not rely on lists being implemented TODO: regen samples
1 parent cea4b14 commit 395435f

3 files changed

Lines changed: 6 additions & 21 deletions

File tree

biscuit-auth/examples/testcases.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ fn closures(target: &str, root: &KeyPair, test: bool) -> TestResult {
21952195
validate_token(
21962196
root,
21972197
&data[..],
2198-
"allow if [true].any($p -> [true].all($p -> $p))",
2198+
"allow if { true }.any($p -> { true }.all($p -> $p))",
21992199
),
22002200
);
22012201

biscuit-auth/samples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ result: `Ok(0)`
30113011

30123012
authorizer code:
30133013
```
3014-
allow if [true].any($p -> [true].all($p -> $p));
3014+
allow if {true}.any($p -> {true}.all($p -> $p));
30153015
```
30163016

30173017
revocation ids:
@@ -3042,7 +3042,7 @@ World {
30423042
},
30433043
]
30443044
policies: [
3045-
"allow if [true].any($p -> [true].all($p -> $p))",
3045+
"allow if {true}.any($p -> {true}.all($p -> $p))",
30463046
]
30473047
}
30483048
```

biscuit-auth/samples/samples.json

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,22 +1068,7 @@
10681068
},
10691069
"result": {
10701070
"Err": {
1071-
"FailedLogic": {
1072-
"Unauthorized": {
1073-
"policy": {
1074-
"Allow": 0
1075-
},
1076-
"checks": [
1077-
{
1078-
"Block": {
1079-
"block_id": 0,
1080-
"check_id": 0,
1081-
"rule": "check if resource($0), $0.matches(\"file[0-9]+.txt\")"
1082-
}
1083-
}
1084-
]
1085-
}
1086-
}
1071+
"RunLimit": "Timeout"
10871072
}
10881073
},
10891074
"authorizer_code": "resource(\"file1\");\n\nallow if true;\n",
@@ -2800,15 +2785,15 @@
28002785
}
28012786
],
28022787
"policies": [
2803-
"allow if [true].any($p -> [true].all($p -> $p))"
2788+
"allow if {true}.any($p -> {true}.all($p -> $p))"
28042789
]
28052790
},
28062791
"result": {
28072792
"Err": {
28082793
"Execution": "ShadowedVariable"
28092794
}
28102795
},
2811-
"authorizer_code": "allow if [true].any($p -> [true].all($p -> $p));\n",
2796+
"authorizer_code": "allow if {true}.any($p -> {true}.all($p -> $p));\n",
28122797
"revocation_ids": [
28132798
"2cd348b6df5f08b900903fd8d3fbea0bb89b665c331a2aa2131e0b8ecb38b3550275d4ccd8db35da6c4433eed1d456cfb761e3fcc7845894d891e986ca044b02"
28142799
]

0 commit comments

Comments
 (0)