@@ -163,7 +163,7 @@ set inclusion.
163
163
The logic language is described by the following EBNF grammar:
164
164
165
165
```
166
- <origin_clause> ::= <sp>? "trusting " <origin_element> <sp>? ("," <sp>? <orgin_element > <sp>?)*
166
+ <origin_clause> ::= <sp>? "trusting " <origin_element> <sp>? ("," <sp>? <origin_element > <sp>?)*
167
167
<origin_element> ::= "authority" | "previous" | <signature_alg> "/" <bytes>
168
168
<signature_alg> ::= "ed25519"
169
169
@@ -291,23 +291,27 @@ To validate an operation, all of a token's checks must succeed.
291
291
292
292
One block can contain one or more checks.
293
293
294
- Their text representation is ` check if ` or ` check all ` followed by the body of the query.
294
+ Their text representation is ` check if ` , ` check all ` or ` reject if ` followed by the body of the query.
295
295
There can be multiple queries inside of a check, it will succeed if any of them
296
- succeeds. They are separated by a ` or ` token.
296
+ succeeds (in the case of ` reject if ` , the check will fail if any query matches) . They are separated by a ` or ` token.
297
297
298
298
- a ` check if ` query succeeds if it finds one set of facts that matches the body and expressions
299
299
- a ` check all ` query succeeds if all the sets of facts that match the body also succeed the expression.
300
- ` check all ` can only be used starting from block version 4
300
+ - a ` reject if ` query succeeds if no set of facts matches the body and expressions
301
+
302
+ ` check all ` can only be used starting from block version 4.
303
+ ` reject if ` can only be used starting from block version 5.
301
304
302
305
Here are some examples of writing checks:
303
306
304
307
#### Basic token
305
308
306
309
This first token defines a list of authority facts giving ` read ` and ` write `
307
- rights on ` file1 ` , ` read ` on ` file2 ` . The first caveat checks that the operation
310
+ rights on ` file1 ` , ` read ` on ` file2 ` . The first check ensures that the operation
308
311
is ` read ` (and will not allow any other ` operation ` fact), and then that we have
309
- the ` read ` right over the resource.
310
- The second caveat checks that the resource is ` file1 ` .
312
+ the ` read ` right over the resource.
313
+ The second check ensures that the resource is either ` file1 ` or ` file2 ` .
314
+ The third check ensures that the resource is not ` file1 ` .
311
315
312
316
```
313
317
authority:
@@ -323,20 +327,24 @@ check if
323
327
----------
324
328
Block 2:
325
329
check if
326
- resource("file1") // restrict to file1 resource
330
+ resource("file1")
331
+ or resource("file2") // restrict to file1 or file2
332
+ ----------
333
+ Block 3:
334
+ reject if
335
+ resource("file1") // forbid using the token on file1
327
336
```
328
337
329
338
The verifier side provides the ` resource ` and ` operation ` facts with information
330
339
from the request.
331
340
332
- If the verifier provided the facts ` resource("file2 ") ` and
341
+ If the verifier provided the facts ` resource("file1 ") ` and
333
342
` operation("read") ` , the rule application of the first check would see
334
- ` resource("file2"), operation("read"), right("file2", "read") `
335
- with ` X = "file2" ` , so it would succeed, but the second check would fail
336
- because it expects ` resource("file1") ` .
343
+ ` resource("file1"), operation("read"), right("file1", "read") `
344
+ with ` X = "file1" ` , so it would succeed, the second check would also succeed because it expects ` resource("file1") ` or ` resource("file2") ` . The third check would then fail because it would match on ` resource("file1") ` .
337
345
338
- If the verifier provided the facts ` resource("file1 ") ` and
339
- ` operation("read") ` , both checks would succeed.
346
+ If the verifier provided the facts ` resource("file2 ") ` and
347
+ ` operation("read") ` , all checks would succeed.
340
348
341
349
#### Broad authority rules
342
350
@@ -661,7 +669,7 @@ each block must carry its own version.
661
669
when possible, especially for biscuit versions that are only additive in terms of features.
662
670
663
671
- The lowest supported biscuit version is ` 3 ` ;
664
- - The highest supported biscuit version is ` 4 ` ;
672
+ - The highest supported biscuit version is ` 5 ` ;
665
673
666
674
# Version 2
667
675
0 commit comments