mirror of
https://github.com/biscuit-auth/biscuit.git
synced 2024-10-06 02:27:33 +03:00
samples: add sealed token sample
This commit is contained in:
parent
6c9f12d4b6
commit
bc3a34b3b9
@ -829,6 +829,52 @@
|
||||
"verifier_code": "operation(\"write\");\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "sealed token",
|
||||
"filename": "test20_sealed.bc",
|
||||
"token": [
|
||||
{
|
||||
"symbols": [
|
||||
"file1",
|
||||
"read",
|
||||
"file2",
|
||||
"write"
|
||||
],
|
||||
"code": "right(\"file1\", \"read\");\nright(\"file2\", \"read\");\nright(\"file1\", \"write\");\n"
|
||||
},
|
||||
{
|
||||
"symbols": [
|
||||
"check1",
|
||||
"0"
|
||||
],
|
||||
"code": "check if resource($0), operation(\"read\"), right($0, \"read\");\n"
|
||||
}
|
||||
],
|
||||
"validations": {
|
||||
"": {
|
||||
"world": {
|
||||
"facts": [
|
||||
"operation(\"read\")",
|
||||
"resource(\"file1\")",
|
||||
"revocation_id(0, hex:b0eb17f363e71adaac3a571d2b813321414dd9dc8714a767185a862575bd16a6b73b19655ffe1c6dcbb75c35715b3298ae29595287cbc8fafeb4d676292d3b02)",
|
||||
"revocation_id(1, hex:7e57a5130b5ccf8383cb74e60ebb240ac5339433fd6cc4b904c7583bd522a404fd391fc09138b3a8fa73a58d4facd05577f4e72acb7ef36be7e0dc885272ad00)",
|
||||
"right(\"file1\", \"read\")",
|
||||
"right(\"file1\", \"write\")",
|
||||
"right(\"file2\", \"read\")"
|
||||
],
|
||||
"rules": [],
|
||||
"checks": [],
|
||||
"policies": [
|
||||
"allow if true"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"Ok": 0
|
||||
},
|
||||
"verifier_code": "resource(\"file1\");\noperation(\"read\");\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
BIN
samples/v2/test20_sealed.bc
Normal file
BIN
samples/v2/test20_sealed.bc
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user