Before you start
- Node.js
- Go
- .NET
- Python
- Java
- CLI
- curl
- Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_URL and, if needed, FGA_API_TOKEN.
- You have installed the SDK.
- You have configured the authorization model and updated the relationship tuples.
- You have loaded
FGA_STORE_IDandFGA_API_URLas environment variables.
Step by step
Consider the following model which includes auser that can have a reader relationship with a document:
Assume that you want to list all objects of type document that user anne has reader relationship with:
01. Configure the OpenFGA API client
Before calling the check API, you will need to configure the API client.- Node.js
- Go
- .NET
- Python
- Java
- CLI
- curl
02. Calling list objects API
To return all documents that useruser:anne has relationship reader with:
The result document:otherdoc and document:planning are the document objects that user:anne has reader relationship with.
Streamed List Objects
The Streamed ListObjects API is similar to the ListObjects API, with two key differences:- Streaming Response: Instead of collecting all objects before returning a response, it streams them to the client as they are collected.
- No Result Limit: The number of results returned is only limited by the execution timeout specified in the flag
OPENFGA_LIST_OBJECTS_DEADLINE, not by a fixed limit.
The streaming functionality is currently available in the Node.js SDK, Go SDK, .NET SDK, Python SDK, and Java SDK.
Using Streamed List Objects
- Node.js
- Go
- .NET
- Python
- Java
Related Sections
Take a look at the following section for more on how to perform authorization checks in your systemOpenFGA List Objects API
Read the List Objects API documentation and see how it works.
OpenFGA Streamed List Objects API
Read the Streamed List Objects API documentation.