Skip to content

Commit

Permalink
samples: add sealed token sample
Browse files Browse the repository at this point in the history
  • Loading branch information
divarvel committed Sep 24, 2021
1 parent 6c9f12d commit bc3a34b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions samples/v2/samples.json
Expand Up @@ -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"
}
}
}
]
}
Binary file added samples/v2/test20_sealed.bc
Binary file not shown.

0 comments on commit bc3a34b

Please sign in to comment.