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:
Geoffroy Couprie 2020-02-13 14:57:41 +01:00
parent 0b015a6ce7
commit 04a789e7f1
2 changed files with 35 additions and 0 deletions

View File

@ -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)" })])))`

Binary file not shown.