Skip to content

Commit c96ec77

Browse files
authored
feat: add support for contextual tuples in assertions API (#185)
* Revert "Reverting contextual tuples in assertions API (#157) (#167)" This reverts commit 5b0b494. * undo go.mod changes * amend API descriptions * run make * apply suggestion
1 parent 7e5be7b commit c96ec77

File tree

4 files changed

+1630
-1566
lines changed

4 files changed

+1630
-1566
lines changed

docs/openapiv2/apidocs.swagger.json

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openfga/v1/openfga_service.proto

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ service OpenFGAService {
561561
description:
562562
"The WriteAssertions API will upsert new assertions for an authorization model id, "
563563
"or overwrite the existing ones. An assertion is an object that contains a "
564-
"tuple key, and the expectation of whether a call to the Check API of that tuple key "
565-
"will return true or false. "
564+
"tuple key, the expectation of whether a call to the Check API of that tuple key "
565+
"will return true or false, and optionally a list of contextual tuples."
566566
responses: {
567567
key: "204"
568568
value: {
@@ -584,9 +584,7 @@ service OpenFGAService {
584584
operation_id: "ReadAssertions"
585585
description:
586586
"The ReadAssertions API will return, for a given authorization model id, "
587-
"all the assertions stored for it. An assertion is an object that contains a "
588-
"tuple key, and the expectation of whether a call to the Check API of that tuple key "
589-
"will return true or false. "
587+
"all the assertions stored for it. "
590588
};
591589
}
592590

@@ -1588,6 +1586,12 @@ message Assertion {
15881586
json_name = "expectation",
15891587
(google.api.field_behavior) = REQUIRED
15901588
];
1589+
1590+
repeated TupleKey contextual_tuples = 3 [
1591+
json_name = "contextual_tuples",
1592+
(validate.rules).repeated.max_items = 20,
1593+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {maximum: 20}
1594+
];
15911595
}
15921596

15931597
message Assertions {

0 commit comments

Comments
 (0)