-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for bulk check in steelthread test
Also adds a two very basic bulk check steelthread tests
- Loading branch information
1 parent
397fefb
commit 2effb83
Showing
5 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...services/steelthreadtesting/steelresults/basic-bulk-checks-basic-bulk-checks-results.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- 'document:doc-1#view@user:user-0 -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:doc-1#view@user:user-1 -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:doc-1#view@user:user-2 -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:doc-2#view@user:user-0 -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:doc-2#view@user:user-1 -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:doc-2#view@user:user-2 -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:doc-3#view@user:user-0 -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:doc-3#view@user:user-1 -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:doc-3#view@user:user-2 -> PERMISSIONSHIP_NO_PERMISSION' |
15 changes: 15 additions & 0 deletions
15
...services/steelthreadtesting/steelresults/bulk-checks-with-traits-bulk-checks-results.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- 'document:firstdoc#view@user:tom -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:firstdoc#view@user:fred -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:seconddoc#view@user:tom -> PERMISSIONSHIP_CONDITIONAL_PERMISSION' | ||
- 'document:seconddoc#view@user:fred -> PERMISSIONSHIP_CONDITIONAL_PERMISSION' | ||
- 'document:seconddoc#view@user:tom[unused:{"somecondition": 41}] -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:seconddoc#view@user:fred[unused:{"somecondition": 41}] -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:seconddoc#view@user:tom[unused:{"somecondition": 42}] -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:seconddoc#view@user:fred[unused:{"somecondition": 42}] -> PERMISSIONSHIP_HAS_PERMISSION' | ||
- 'document:thirddoc#view@user:tom -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:thirddoc#view@user:fred -> PERMISSIONSHIP_CONDITIONAL_PERMISSION' | ||
- 'document:thirddoc#view@user:tom[unused:{"somecondition": 41}] -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:thirddoc#view@user:fred[unused:{"somecondition": 41}] -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:thirddoc#view@user:tom[unused:{"somecondition": 42}] -> PERMISSIONSHIP_NO_PERMISSION' | ||
- 'document:thirddoc#view@user:fred[unused:{"somecondition": 42}] -> PERMISSIONSHIP_HAS_PERMISSION' |
22 changes: 22 additions & 0 deletions
22
internal/services/steelthreadtesting/testdata/document-with-traits.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
schema: |+ | ||
use expiration | ||
definition user {} | ||
caveat somecaveat(somesecret int, somecondition int) { | ||
somecondition == somesecret | ||
} | ||
definition document { | ||
relation viewer: user with expiration | user with somecaveat | user with somecaveat and expiration | ||
permission view = viewer | ||
} | ||
relationships: | | ||
document:firstdoc#viewer@user:tom[expiration:2022-01-02T12:23:34Z] | ||
document:firstdoc#viewer@user:fred[expiration:2322-01-02T12:23:34Z] | ||
document:seconddoc#viewer@user:tom[somecaveat:{"somesecret":41}] | ||
document:seconddoc#viewer@user:fred[somecaveat:{"somesecret":42}] | ||
document:thirddoc#viewer@user:tom[somecaveat:{"somesecret":41}][expiration:2022-01-02T12:23:34Z] | ||
document:thirddoc#viewer@user:fred[somecaveat:{"somesecret":42}][expiration:2322-01-02T12:23:34Z] |