rosavox/lib/alveolata/accesscontrol/testdata.json
2025-05-23 07:33:29 +00:00

61 lines
1.2 KiB
JSON

{
"check": {
"parameters": {
"acl": {
"default": [
],
"concrete": {
"bar": [
],
"baz": [
[
{"type": "password", "parameters": {"value": "correct"}}
]
]
}
}
},
"cases": [
{
"name": "should fall back to default if the action is unknown",
"input": {
"action": "qux",
"state": {}
},
"output": false
},
{
"name": "should forbid access if the state is bad and no checker is given",
"input": {
"action": "bar",
"state": {"password": "wrong"}
},
"output": false
},
{
"name": "should forbid access if the state is good but no checker is given",
"input": {
"action": "bar",
"state": {"password": "correct"}
},
"output": false
},
{
"name": "should forbid access if the state is bad but does not match the checker",
"input": {
"action": "baz",
"state": {"password": "wrong"}
},
"output": false
},
{
"name": "should grant access if the state is good and matches the checker",
"input": {
"action": "baz",
"state": {"password": "correct"}
},
"output": true
}
]
}
}