From 7928a1b56a3debef82b22c588ce7254ba085f0c4 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Thu, 8 Feb 2024 16:15:34 +0000 Subject: [PATCH 1/3] docs: update read doc string --- api_open_fga.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api_open_fga.go b/api_open_fga.go index 589caad..bfeef05 100644 --- a/api_open_fga.go +++ b/api_open_fga.go @@ -221,7 +221,9 @@ type OpenFgaApi interface { /* * Read Get tuples from the store that matches a query, without following userset rewrite rules - * The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. + * The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. + The API doesn't guarantee order by any field. + It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. In the body: 1. `tuple_key` is optional. If not specified, it will return all tuples in the store. 2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`). @@ -2544,8 +2546,10 @@ func (r ApiReadRequest) Execute() (ReadResponse, *_nethttp.Response, error) { /* - Read Get tuples from the store that matches a query, without following userset rewrite rules - - The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. + - The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. +The API doesn't guarantee order by any field. +It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. In the body: 1. `tuple_key` is optional. If not specified, it will return all tuples in the store. 2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`). From 42b72915f827f7036b5ff6a1f7e07f3c48bbc42b Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Thu, 8 Feb 2024 16:16:43 +0000 Subject: [PATCH 2/3] fix: fix example makefile to run openfga Co-authored-by: Jim Anderson --- example/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/Makefile b/example/Makefile index 8f8921e..b14e64e 100644 --- a/example/Makefile +++ b/example/Makefile @@ -11,4 +11,4 @@ run: restore run-openfga: docker pull docker.io/openfga/openfga:${openfga_version} && \ - docker run -p 8080:8080 docker.io/openfga/openfga:${openfga_version} + docker run -p 8080:8080 docker.io/openfga/openfga:${openfga_version} run From 4f67e2d338646afff01abf61d471811096a3f5b2 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Fri, 9 Feb 2024 10:58:25 +0000 Subject: [PATCH 3/3] chore: add test to cover not sending empty array when other has data --- client/client_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/client_test.go b/client/client_test.go index ec39bbe..27b60fe 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -972,6 +972,7 @@ func TestOpenFgaClient(t *testing.T) { Relation: "viewer", Object: "document:roadmap", }}, + Deletes: []ClientTupleKeyWithoutCondition{}, } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"),