You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We added support to the API for Assertions to support context and contextual tuples, given that these are supported in the store file format we should add support for them in the fga store import and fga store export commands.
Describe the ideal solution
Store Import
When importing the assertions in a store file, we should add the contents of context and tuples/tuple_file in a test definition to every
So the following test definition:
Test definition
tests:
- name: "folder-document-access"tuples:
- user: folder:5relation: parentobject: folder:product-2021check: # Each check test is made of: a user, an object and the expected result for one or more relations
- user: user:anneobject: folder:product-2021context:
some: "value"assertions:
can_view: truecan_edit: true
Should produce the following assertions, note that the tuples and context are present in both assertions
This isn't as clear and needs more definition on the behaviour
When exporting a store, we should each ModelTestCheck should maintain its own context but the contextual_tuples should most likely be merged together into the tuples on the top level ModelTest.
tests:
- name: "folder-document-access"tuples:
- user: folder:5relation: parentobject: folder:product-2021check: # Each check test is made of: a user, an object and the expected result for one or more relations
- user: user:anneobject: folder:product-2021context:
some: "value"assertions:
can_view: truecan_edit: true
Should produce the following assertions, note that the tuples and context are present in both assertions
Additional context
This needs this PR in go-sdk to be merged and ship before it can be done.
The playground UI currently does not support adding either of these or sending either of them as part of the Check call if they exist
The text was updated successfully, but these errors were encountered:
Describe the problem you'd like to have solved
We added support to the API for
Assertions
to support context and contextual tuples, given that these are supported in the store file format we should add support for them in thefga store import
andfga store export
commands.Describe the ideal solution
Store Import
When importing the assertions in a store file, we should add the contents of
context
andtuples
/tuple_file
in a test definition to everySo the following test definition:
Test definition
Should produce the following assertions, note that the
tuples
andcontext
are present in both assertionsAssertions written
Store Export
Warning
This isn't as clear and needs more definition on the behaviour
When exporting a store, we should each
ModelTestCheck
should maintain its owncontext
but thecontextual_tuples
should most likely be merged together into thetuples
on the top levelModelTest
./assertions response
Test definition
Should produce the following assertions, note that the
tuples
andcontext
are present in both assertionsAdditional context
This needs this PR in go-sdk to be merged and ship before it can be done.
The playground UI currently does not support adding either of these or sending either of them as part of the
Check
call if they existThe text was updated successfully, but these errors were encountered: