Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test to cover not sending empty array when other has data #75

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions api_open_fga.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:`).
Expand Down Expand Up @@ -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:`).
Expand Down
1 change: 1 addition & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ func TestOpenFgaClient(t *testing.T) {
Relation: "viewer",
Object: "document:roadmap",
}},
Deletes: []ClientTupleKeyWithoutCondition{},
}
options := ClientWriteOptions{
AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"),
Expand Down
2 changes: 1 addition & 1 deletion example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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