Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zcemycl committed Jul 25, 2024
1 parent 02f78aa commit d11e8df
Show file tree
Hide file tree
Showing 3 changed files with 689 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/containers/docker/openfga/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import asyncio
import json
import os

from openfga_sdk.client import ClientConfiguration, OpenFgaClient


async def main():
configuration = ClientConfiguration(
api_url = os.environ.get('FGA_API_URL'), # required, e.g. https://api.fga.example
store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods
authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request
)

# Enter a context with an instance of the OpenFgaClient
async with OpenFgaClient(configuration) as fga_client:
api_response = await fga_client.read_authorization_models()
await fga_client.close()

asyncio.run(main())
Loading

0 comments on commit d11e8df

Please sign in to comment.