openfga / roadmap

OpenFGA Public Roadmap
2 stars 0 forks source link

Improved Filtering for Read API #33

Open aaguiarz opened 1 year ago

aaguiarz commented 1 year ago

The current implementation of the Read API lets you filter read tuples in a few ways:

However, there are several scenarios where you need more flexibility:

lorenlew commented 1 year ago

"The Read API will only return all the stored relationships that match the query specification. It does not expand or traverse the graph by taking the authorization model into account." docs Would it be possible (considered in the design) later taking the authorization model into account?

aaguiarz commented 1 year ago

The goal of the Read API is to read the tuples you've written.

ListObjects / ListRelations (available in the SDKs for now) / ListUsers (in the roadmap) are the endpoints you'd use if you want to query the FGA store taking into account the relations defined in the authorization model.

krishna-se commented 10 months ago

Hi Team, Can we have the feature to fetch data with multiple relationships? Below is the request payload.

{
  "object": "team:x",
  "relation": ["admin", "member"],
}

Here fetch all members and admin of a team x. And the response is like.

{
    "tuples": [
        {
            "key": {
                "user": "user:3",
                "relation": "member",
                "object": "doc:2",
                "condition": null
            },
            "timestamp": "2023-12-11T06:26:04.136575Z"
        },
        {
            "key": {
                "user": "user:38",
                "relation": "admin",
                "object": "doc:2",
                "condition": null
            },
            "timestamp": "2023-12-11T06:36:50.617780Z"
        },
        {
            "key": {
                "user": "user:34",
                "relation": "admin",
                "object": "doc:2",
                "condition": null
            },
            "timestamp": "2023-12-11T06:36:50.630055Z"
        }
}