openfga / python-sdk

OpenFGA SDK for Python 3 - https://pypi.org/project/openfga-sdk/
https://openfga.dev
Apache License 2.0
35 stars 14 forks source link

get_store should have an optional store_id parameter #9

Open misterflop opened 1 year ago

misterflop commented 1 year ago

In the current implementation, get_store return the OpenFGA store specified in the client_api configuration. Except by listing all the stores with list_stores, I don't see any other way to get a specific store different of the one defined in the configuration. A way to arrange that would be to add an optional store_id parameter to get_store.

Part of https://github.com/openfga/sdk-generator/issues/118

misterflop commented 1 year ago

Same issue with delete_store. In the current implemantation, we have to create a specific client_api for every store that we would like to delete.

rhamzeh commented 1 year ago

Hi @misterflop

Currently, our SDKs now expect you to generate a new client per store. In the future (as part of https://github.com/openfga/sdk-generator/issues/118) we are exploring offering two different interfaces which would allow us to have one that allows calling one with dynamic storeIds, but I don't expect that to be soon

Can you elaborate on your use-case where you would need to call multiple stores with the same client?

misterflop commented 1 year ago

Hello,

Thank you for your answer.

I see two use cases on my side:

The openFGA API allows to request per store ID. The SDK should ideally have the same contract.

JRudransh commented 8 months ago

In my organization, we are also facing the similar kind of Issue. To solve that we have built another wrapper microservice around the openfga sdk. You can also try the same. It will be more flexible for you