Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/python bump to 0.3.0 #231

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/clients/python/CHANGELOG.md.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.3.0

### [0.3.0](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.2.1...v0.3.0) (2023-11-02)
- feat(client): introduce synchronous OpenFgaClient (https://github.com/openfga/python-sdk/commit/c92b436543e263f2c1af6af15f1c4fda1c9dad21)
- refactor(config): extract oauth2 from credentials, removing logic from credentials configuration (https://github.com/openfga/python-sdk/commit/f91d14b25f86dd3f2e4d48229bb53cc7d9b20f1b)
- feat(client): performance improvements to batch_check (https://github.com/openfga/python-sdk/commit/d8f2d429d2c279c0e56d5ef2a6172df8bfadd82b)

## v0.2.1

### [0.2.1](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.2.0...v0.2.1) (2023-09-05)
Expand Down
2 changes: 1 addition & 1 deletion config/clients/python/config.overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sdkId": "python",
"gitRepoId": "python-sdk",
"packageName": "openfga_sdk",
"packageVersion": "0.2.1",
"packageVersion": "0.3.0",
"packageDescription": "Python SDK for OpenFGA",
"packageDetailedDescription": "This is an autogenerated python SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).",
"fossaComplianceNoticeId": "2f8a8629-b46c-435e-b8cd-1174a674fb4b",
Expand Down
23 changes: 23 additions & 0 deletions config/clients/python/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,26 @@ async def main():
await fga_client.close()

```

#### Synchronous Client

To run outside of an async context, the project exports a synchronous client
from `openfga_sdk.sync` that supports all the credential types and calls,
without requiring async/await.

```python
import {{packageName}}
from {{packageName}}.sync.client import OpenFgaClient


def main():
configuration = {{packageName}}.ClientConfiguration(
api_scheme={{appUpperCaseName}}_API_SCHEME, # optional, defaults to "https"
api_host={{appUpperCaseName}}_API_HOST, # required, define without the scheme (e.g. api.{{sampleApiDomain}} instead of https://api.{{sampleApiDomain}})
store_id={{appUpperCaseName}}_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores`
authorization_model_id={{appUpperCaseName}}_AUTHORIZATION_MODEL_ID, # optional, can be overridden per request
)
# Enter a context with an instance of the OpenFgaClient
with OpenFgaClient(configuration) as fga_client:
api_response = fga_client.read_authorization_models()
```
Loading