-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
689 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
Oops, something went wrong.