mirror of
https://github.com/biscuit-auth/biscuit.git
synced 2024-10-06 02:27:33 +03:00
add a test case for the caveat name check
if there's a fact with the same format as a caveat's head, it will not validate the caveat
This commit is contained in:
parent
0b015a6ce7
commit
04a789e7f1
@ -575,3 +575,38 @@ World {
|
||||
rules: []
|
||||
}
|
||||
validation: `Ok(())`
|
||||
|
||||
------------------------------
|
||||
|
||||
## caveat head name should be independent from fact names: test16_caveat_head_name.bc
|
||||
biscuit: Biscuit {
|
||||
symbols: ["authority", "ambient", "resource", "operation", "right", "current_time", "revocation_id", "caveat1", "test", "hello"]
|
||||
authority: Block[0] {
|
||||
symbols: ["caveat1", "test", "hello"]
|
||||
context: ""
|
||||
facts: []
|
||||
rules: []
|
||||
caveats: [
|
||||
*caveat1(#test) <- !resource(#ambient, #hello)
|
||||
]
|
||||
}
|
||||
blocks: [
|
||||
Block[1] {
|
||||
symbols: []
|
||||
context: ""
|
||||
facts: [
|
||||
!caveat1(#test)
|
||||
]
|
||||
rules: []
|
||||
caveats: []
|
||||
}
|
||||
]
|
||||
}
|
||||
verifier world:
|
||||
World {
|
||||
facts: [
|
||||
"!caveat1(#test)",
|
||||
]
|
||||
rules: []
|
||||
}
|
||||
validation: `Err(FailedLogic(FailedCaveats([Block(FailedBlockCaveat { block_id: 0, caveat_id: 0, rule: "*caveat1(#test) <- !resource(#ambient, #hello)" })])))`
|
||||
|
BIN
samples/test16_caveat_head_name.bc
Normal file
BIN
samples/test16_caveat_head_name.bc
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user