openfga / openfga/python-sdk

Read and write using different tuple models

Open
#106 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
85
Forks
36
Avg merge
3h 8m
Merged PRs (30d)
3

Description

Checklist
Describe the problem you'd like to have solved

I added the SDK to our backend yesterday and found that there are two different models being used when reading from the store and writing to the store.

from openfga_sdk import ReadRequestTupleKey, Tuple as FgaTuple
from openfga_sdk.client.models import ClientTuple

What's the reason for this? It would just save us some code to convert between them and make things cleaner with a single model/source of truth in the backend.

Thanks!

Describe the ideal solution

Read and write uses the same model for tuples

Alternatives and current workarounds

Cast in between them when reading, altering, and writing back to the store.

References

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the definitions and usages of ReadRequestTupleKey, FgaTuple, and ClientTuple in the SDK, then compare the read and write request paths. The work is done when both paths use one tuple model and callers no longer need to cast between them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.