Skip to content

Commit

Permalink
Merge pull request #246 from biscuit-auth/force-sig-v1
Browse files Browse the repository at this point in the history
force using signature v1 in more cases
  • Loading branch information
divarvel authored Nov 21, 2024
2 parents d956655 + bf80230 commit fe3e74d
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 58 deletions.
6 changes: 3 additions & 3 deletions biscuit-auth/examples/testcases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
46 changes: 23 additions & 23 deletions biscuit-auth/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ revocation ids:
- `7113d4dbb3b688b80e941f365a2c6342d480c77ed03937bccf85dc5cc3554c7517887b1b0c9021388a71e6ca9047aabaaad5ae5b511a2880902568444a98e50b`
- `d0e3fc4bbd1b7320022800af909585aa906f677c4ca79c275a10b6779f669384c464ee84a1b04f13877a25761a874748362c065f4d15a8cab5c5e16c34074403`
- `29b7e0a1f118a6185814a552660c516c43482044e280e7a8de85b8e7e54947e0ae82eb39d7b524d4b72cb9812a7a4b8871964f8f825b1c1ed85d344c05281d0d`
- `3f675d6c364e06405d4868c904e40f3d81c32b083d91586db814d4cb4bf536b4ba209d82f11b4cb6da293b60b20d6122fc3e0e08e80c381dee83edd848211900`
- `c0a505d4d921a8b2d0b885917d42e2bca87b5302d13249a61af6f3802af44d691c40a624f901d677724740cb974a188aeb1c3992c1565ac0fbec3aa4f68dac0a`

authorizer world:
```
Expand Down Expand Up @@ -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
Expand All @@ -2270,7 +2270,7 @@ allow if true;
```

revocation ids:
- `31f01031b8d9cc312c346674625a2218b19a126e931318dc02d8d53aec2775faecd3f848f60c1446573c37ea0664fefc768f35ba5ce4365b83ff06f0c0409b0e`
- `fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c`

authorizer world:
```
Expand All @@ -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",
],
},
]
Expand Down Expand Up @@ -2380,7 +2380,7 @@ allow if true;
```

revocation ids:
- `2e6dcafe4061dd86f61ad038a0a1bea816b85898bb86a14b16177e78ee249fcfb2455e2eed52ccfe8eafc679b1f34f9ef98e92e3719981dd4098b901b6cb040b`
- `8d175329f7cf161f3cb5badc52f0e22e520956cdb565edbed963e9b047b20a314a7de1c9eba6b7bbf622636516ab3cc7f91572ae9461d3152825e0ece5127a0a`

authorizer world:
```
Expand Down Expand Up @@ -2423,7 +2423,7 @@ allow if true;
```

revocation ids:
- `2e6dcafe4061dd86f61ad038a0a1bea816b85898bb86a14b16177e78ee249fcfb2455e2eed52ccfe8eafc679b1f34f9ef98e92e3719981dd4098b901b6cb040b`
- `8d175329f7cf161f3cb5badc52f0e22e520956cdb565edbed963e9b047b20a314a7de1c9eba6b7bbf622636516ab3cc7f91572ae9461d3152825e0ece5127a0a`

authorizer world:
```
Expand Down Expand Up @@ -2483,7 +2483,7 @@ allow if true;
```

revocation ids:
- `c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f`
- `fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b`

authorizer world:
```
Expand Down Expand Up @@ -2527,7 +2527,7 @@ allow if true;
```

revocation ids:
- `c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f`
- `fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b`

authorizer world:
```
Expand Down Expand Up @@ -2571,7 +2571,7 @@ allow if true;
```

revocation ids:
- `c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f`
- `fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b`

authorizer world:
```
Expand Down Expand Up @@ -2615,7 +2615,7 @@ allow if true;
```

revocation ids:
- `c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f`
- `fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b`

authorizer world:
```
Expand Down Expand Up @@ -2696,7 +2696,7 @@ allow if true;
```

revocation ids:
- `899521bb50786bd40a21bf22c9362b021a9300e20cbf1b8b2f70bd1f5a9b01c420efeab85092f081db71ce7b7cebfc01b4a4f8f2294c478ce4c7f8813ffa5c0f`
- `be50b2040f4b5fe278b87815910d249eeb9ca5238cae4ea538e22afda11f576e868cbfe7e6b0a03b02ae0f22239ec908947d4bad5a878e4b9f7bd7de73e5c90a`

authorizer world:
```
Expand Down Expand Up @@ -2763,7 +2763,7 @@ allow if true;
```

revocation ids:
- `899521bb50786bd40a21bf22c9362b021a9300e20cbf1b8b2f70bd1f5a9b01c420efeab85092f081db71ce7b7cebfc01b4a4f8f2294c478ce4c7f8813ffa5c0f`
- `be50b2040f4b5fe278b87815910d249eeb9ca5238cae4ea538e22afda11f576e868cbfe7e6b0a03b02ae0f22239ec908947d4bad5a878e4b9f7bd7de73e5c90a`

authorizer world:
```
Expand Down Expand Up @@ -2858,7 +2858,7 @@ allow if true;
```

revocation ids:
- `ef75002a071b56293152a4c9eb69ba0793614993e667736a6a92275ddd5aa35a287de5b13acaec72b5af6ba2ee8a3629b1a33cfa51597ae5afbebd8aa35dbe08`
- `2cd348b6df5f08b900903fd8d3fbea0bb89b665c331a2aa2131e0b8ecb38b3550275d4ccd8db35da6c4433eed1d456cfb761e3fcc7845894d891e986ca044b02`

authorizer world:
```
Expand Down Expand Up @@ -2899,7 +2899,7 @@ allow if [true].any($p -> [true].all($p -> $p));
```

revocation ids:
- `ef75002a071b56293152a4c9eb69ba0793614993e667736a6a92275ddd5aa35a287de5b13acaec72b5af6ba2ee8a3629b1a33cfa51597ae5afbebd8aa35dbe08`
- `2cd348b6df5f08b900903fd8d3fbea0bb89b665c331a2aa2131e0b8ecb38b3550275d4ccd8db35da6c4433eed1d456cfb761e3fcc7845894d891e986ca044b02`

authorizer world:
```
Expand Down Expand Up @@ -2980,7 +2980,7 @@ allow if true;
```

revocation ids:
- `c8f7ff152b40a3e8f3ab19a435ccd16c41288762864022895b99d2abb6330c794b3f1378a4651b31d249f4c35b69246d88124d40e05e634a0eb9ca9e54b1ca0a`
- `e60875c6ef7917c227a5e4b2cabfe250a85fa0598eb3cf7987ded0da2b69a559a1665bd312aeecde78e76aeb28ea1c1a03ec9b7dec8aeb519e7867ef8ff9b402`

authorizer world:
```
Expand Down Expand Up @@ -3088,7 +3088,7 @@ allow if true;
```

revocation ids:
- `8041144f92616477f1cd00b81e8be79581202a3853b08b3d477797b0d91f30c02fd7c01ca91a00f8a222d6be4794cc287baa361a1a00d5941518c1917967ec03`
- `b22238a06ca9c015d3c49d4ebaa7e8ab6e0d69119b3264033618e726d62fc6f4757a7bebc25f255444aba39994554a62a53ecc13b68802efab8da85ace62390d`

authorizer world:
```
Expand Down Expand Up @@ -3162,7 +3162,7 @@ allow if true;
```

revocation ids:
- `faf26fe6f5dfa08c114a0a29321405b6fb7be79b0d80694d27925f7deb01effe5707600e42fd74f9a1d2920466446d51949155f4548f0fd68f3e9326c7e12404`
- `d1719fd101c2695d2dac4df67569918363f691b6167670e1dbbf8026f639a7aa1ec2e13707f4d34cadbb2adce5c6e8a816577dd069a8717e0f5cb4ea3cec5b04`

authorizer world:
```
Expand Down Expand Up @@ -3224,8 +3224,8 @@ allow if true;
```

revocation ids:
- `760785de30d7348e9c847aab8b3bdad6a0d463f4f50ed9667aade563e9112ee6d2f589630dd7553c2eced2a57edf3636d5c874b35df15120c62fddcbdbd2de09`
- `30440220039667c7a4d964e4b449289dc8fd206d7aa0e77eb701a9253b3307d32c177fa8022023f7523c143c5fb55ee4cafe49804702ef05a70883ebf42185b54bd36a7e7cd4`
- `628b9a6d74cc80b3ece50befd1f5f0f025c0a35d51708b2e77c11aed5f968b93b4096c87ed8169605716de934e155443f140334d71708fcc4247e5a0a518b30d`
- `3046022100b60674854a12814cc36c8aab9600c1d9f9d3160e2334b72c0feede5a56213ea5022100a4f4bbf2dc33b309267af39fce76612017ddb6171e9cd2a3aa8a853f45f1675f`

authorizer world:
```
Expand Down
42 changes: 21 additions & 21 deletions biscuit-auth/samples/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@
"7113d4dbb3b688b80e941f365a2c6342d480c77ed03937bccf85dc5cc3554c7517887b1b0c9021388a71e6ca9047aabaaad5ae5b511a2880902568444a98e50b",
"d0e3fc4bbd1b7320022800af909585aa906f677c4ca79c275a10b6779f669384c464ee84a1b04f13877a25761a874748362c065f4d15a8cab5c5e16c34074403",
"29b7e0a1f118a6185814a552660c516c43482044e280e7a8de85b8e7e54947e0ae82eb39d7b524d4b72cb9812a7a4b8871964f8f825b1c1ed85d344c05281d0d",
"3f675d6c364e06405d4868c904e40f3d81c32b083d91586db814d4cb4bf536b4ba209d82f11b4cb6da293b60b20d6122fc3e0e08e80c381dee83edd848211900"
"c0a505d4d921a8b2d0b885917d42e2bca87b5302d13249a61af6f3802af44d691c40a624f901d677724740cb974a188aeb1c3992c1565ac0fbec3aa4f68dac0a"
]
}
}
Expand All @@ -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": {
Expand All @@ -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"
]
}
],
Expand All @@ -2132,7 +2132,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"31f01031b8d9cc312c346674625a2218b19a126e931318dc02d8d53aec2775faecd3f848f60c1446573c37ea0664fefc768f35ba5ce4365b83ff06f0c0409b0e"
"fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c"
]
}
}
Expand Down Expand Up @@ -2227,7 +2227,7 @@
},
"authorizer_code": "test(false);\n\nallow if true;\n",
"revocation_ids": [
"2e6dcafe4061dd86f61ad038a0a1bea816b85898bb86a14b16177e78ee249fcfb2455e2eed52ccfe8eafc679b1f34f9ef98e92e3719981dd4098b901b6cb040b"
"8d175329f7cf161f3cb5badc52f0e22e520956cdb565edbed963e9b047b20a314a7de1c9eba6b7bbf622636516ab3cc7f91572ae9461d3152825e0ece5127a0a"
]
},
"rejection": {
Expand Down Expand Up @@ -2277,7 +2277,7 @@
},
"authorizer_code": "test(true);\n\nallow if true;\n",
"revocation_ids": [
"2e6dcafe4061dd86f61ad038a0a1bea816b85898bb86a14b16177e78ee249fcfb2455e2eed52ccfe8eafc679b1f34f9ef98e92e3719981dd4098b901b6cb040b"
"8d175329f7cf161f3cb5badc52f0e22e520956cdb565edbed963e9b047b20a314a7de1c9eba6b7bbf622636516ab3cc7f91572ae9461d3152825e0ece5127a0a"
]
}
}
Expand Down Expand Up @@ -2328,7 +2328,7 @@
},
"authorizer_code": "fact(null, null);\n\nallow if true;\n",
"revocation_ids": [
"c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f"
"fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b"
]
},
"rejection1": {
Expand Down Expand Up @@ -2386,7 +2386,7 @@
},
"authorizer_code": "fact(null, 1);\n\nallow if true;\n",
"revocation_ids": [
"c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f"
"fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b"
]
},
"rejection2": {
Expand Down Expand Up @@ -2444,7 +2444,7 @@
},
"authorizer_code": "fact(null, true);\n\nallow if true;\n",
"revocation_ids": [
"c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f"
"fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b"
]
},
"rejection3": {
Expand Down Expand Up @@ -2502,7 +2502,7 @@
},
"authorizer_code": "fact(null, \"abcd\");\n\nallow if true;\n",
"revocation_ids": [
"c6c60ff84938908ca2bfcc7d674a400857c3349bdb373646c825e946ad0d08d76fd4734cd40f09884db0a41aee0c078897750e27706959d785750ef24acf100f"
"fe50d65706a5945c76569d1ff2be8ece24276857631e96efa05959f73bb4ea8c772945738a01da77a1661aef2b8233b4f4e49ae220f2c81fd0b8da59c212750b"
]
}
}
Expand Down Expand Up @@ -2576,7 +2576,7 @@
},
"authorizer_code": "fact(1, 1);\nfact2(1, 2);\n\nallow if true;\n",
"revocation_ids": [
"899521bb50786bd40a21bf22c9362b021a9300e20cbf1b8b2f70bd1f5a9b01c420efeab85092f081db71ce7b7cebfc01b4a4f8f2294c478ce4c7f8813ffa5c0f"
"be50b2040f4b5fe278b87815910d249eeb9ca5238cae4ea538e22afda11f576e868cbfe7e6b0a03b02ae0f22239ec908947d4bad5a878e4b9f7bd7de73e5c90a"
]
},
"evaluate to false": {
Expand Down Expand Up @@ -2666,7 +2666,7 @@
},
"authorizer_code": "fact(1, 2);\nfact2(1, 1);\n\ncheck if false != false;\n\nallow if true;\n",
"revocation_ids": [
"899521bb50786bd40a21bf22c9362b021a9300e20cbf1b8b2f70bd1f5a9b01c420efeab85092f081db71ce7b7cebfc01b4a4f8f2294c478ce4c7f8813ffa5c0f"
"be50b2040f4b5fe278b87815910d249eeb9ca5238cae4ea538e22afda11f576e868cbfe7e6b0a03b02ae0f22239ec908947d4bad5a878e4b9f7bd7de73e5c90a"
]
}
}
Expand Down Expand Up @@ -2717,7 +2717,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"ef75002a071b56293152a4c9eb69ba0793614993e667736a6a92275ddd5aa35a287de5b13acaec72b5af6ba2ee8a3629b1a33cfa51597ae5afbebd8aa35dbe08"
"2cd348b6df5f08b900903fd8d3fbea0bb89b665c331a2aa2131e0b8ecb38b3550275d4ccd8db35da6c4433eed1d456cfb761e3fcc7845894d891e986ca044b02"
]
},
"shadowing": {
Expand Down Expand Up @@ -2752,7 +2752,7 @@
},
"authorizer_code": "allow if [true].any($p -> [true].all($p -> $p));\n",
"revocation_ids": [
"ef75002a071b56293152a4c9eb69ba0793614993e667736a6a92275ddd5aa35a287de5b13acaec72b5af6ba2ee8a3629b1a33cfa51597ae5afbebd8aa35dbe08"
"2cd348b6df5f08b900903fd8d3fbea0bb89b665c331a2aa2131e0b8ecb38b3550275d4ccd8db35da6c4433eed1d456cfb761e3fcc7845894d891e986ca044b02"
]
}
}
Expand Down Expand Up @@ -2835,7 +2835,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"c8f7ff152b40a3e8f3ab19a435ccd16c41288762864022895b99d2abb6330c794b3f1378a4651b31d249f4c35b69246d88124d40e05e634a0eb9ca9e54b1ca0a"
"e60875c6ef7917c227a5e4b2cabfe250a85fa0598eb3cf7987ded0da2b69a559a1665bd312aeecde78e76aeb28ea1c1a03ec9b7dec8aeb519e7867ef8ff9b402"
]
}
}
Expand Down Expand Up @@ -2909,7 +2909,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"8041144f92616477f1cd00b81e8be79581202a3853b08b3d477797b0d91f30c02fd7c01ca91a00f8a222d6be4794cc287baa361a1a00d5941518c1917967ec03"
"b22238a06ca9c015d3c49d4ebaa7e8ab6e0d69119b3264033618e726d62fc6f4757a7bebc25f255444aba39994554a62a53ecc13b68802efab8da85ace62390d"
]
}
}
Expand Down Expand Up @@ -2951,7 +2951,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"faf26fe6f5dfa08c114a0a29321405b6fb7be79b0d80694d27925f7deb01effe5707600e42fd74f9a1d2920466446d51949155f4548f0fd68f3e9326c7e12404"
"d1719fd101c2695d2dac4df67569918363f691b6167670e1dbbf8026f639a7aa1ec2e13707f4d34cadbb2adce5c6e8a816577dd069a8717e0f5cb4ea3cec5b04"
]
}
}
Expand Down Expand Up @@ -3020,8 +3020,8 @@
},
"authorizer_code": "resource(\"file1\");\noperation(\"read\");\n\nallow if true;\n",
"revocation_ids": [
"760785de30d7348e9c847aab8b3bdad6a0d463f4f50ed9667aade563e9112ee6d2f589630dd7553c2eced2a57edf3636d5c874b35df15120c62fddcbdbd2de09",
"30440220039667c7a4d964e4b449289dc8fd206d7aa0e77eb701a9253b3307d32c177fa8022023f7523c143c5fb55ee4cafe49804702ef05a70883ebf42185b54bd36a7e7cd4"
"628b9a6d74cc80b3ece50befd1f5f0f025c0a35d51708b2e77c11aed5f968b93b4096c87ed8169605716de934e155443f140334d71708fcc4247e5a0a518b30d",
"3046022100b60674854a12814cc36c8aab9600c1d9f9d3160e2334b72c0feede5a56213ea5022100a4f4bbf2dc33b309267af39fce76612017ddb6171e9cd2a3aa8a853f45f1675f"
]
}
}
Expand Down
Binary file modified biscuit-auth/samples/test026_public_keys_interning.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test027_integer_wraparound.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test029_reject_if.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test030_null.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test031_heterogeneous_equal.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test032_laziness_closures.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test033_typeof.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test034_array_map.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test035_ffi.bc
Binary file not shown.
Binary file modified biscuit-auth/samples/test036_secp256r1.bc
Binary file not shown.
Loading

0 comments on commit fe3e74d

Please sign in to comment.