Skip to content

Commit 8d1fecf

Browse files
authored
release(v0.4.0): with conditions and breaking changes (#62)
2 parents 48dbb61 + ee8c02f commit 8d1fecf

14 files changed

+60
-15
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Changelog
22

3+
## v0.4.0
4+
5+
### [0.4.0](https://github.com/openfga/python-sdk/compare/v0.3.4...v0.4.0) (2024-01-11)
6+
7+
- feat: support for [conditions](https://openfga.dev/blog/conditional-tuples-announcement)
8+
- chore!: use latest API interfaces for type info
9+
- chore: add [example project](./example)
10+
- chore: dependency updates
11+
12+
BREAKING CHANGES:
13+
Note: This release comes with substantial breaking changes, especially to the interfaces due to the protobuf changes in the last release.
14+
15+
While the http interfaces did not break (you can still use `v0.3.3` SDK with a `v1.3.8+` server),
16+
the grpc interface did and this caused a few changes in the interfaces of the SDK.
17+
18+
If you are using `OpenFgaClient`, the changes required should be smaller, if you are using `OpenFgaApi` a bit more changes will be needed.
19+
20+
You will have to modify some parts of your code, but we hope this will be to the better as a lot of the parameters are now correctly marked as required,
21+
and so the Pointer-to-String conversion is no longer needed.
22+
23+
Some of the changes to expect:
24+
- The following request interfaces changed:
25+
- `CheckRequest`: the `TupleKey` field is now of interface `CheckRequestTupleKey`, you can also now pass in `Context`
26+
- `ExpandRequest`: the `TupleKey` field is now of interface `ExpandRequestTupleKey`
27+
- `ReadRequest`: the `TupleKey` field is now of interface `ReadRequestTupleKey`
28+
- `WriteRequest`: now takes `WriteRequestWrites` and `WriteRequestDeletes`, the latter of which accepts `TupleKeyWithoutCondition`
29+
- And more
30+
- The following interfaces had fields that were optional are are now required:
31+
- `CreateStoreResponse`
32+
- `GetStoreResponse`
33+
- `ListStoresResponse`
34+
- `ListObjectsResponse`
35+
- `ReadChangesResponse`
36+
- `ReadResponse`
37+
- `AuthorizationModel`
38+
- And more
39+
40+
Take a look at the changes in models in https://github.com/openfga/python-sdk/commit/9ed1f70d64db71451de2eb26e330bbd511625c5c and https://github.com/openfga/python-sdk/pull/59/files for more.
41+
42+
## v0.3.4
43+
44+
### [0.3.4](https://github.com/openfga/python-sdk/compare/v0.3.3...v0.3.4) (2024-01-09)
45+
46+
Note: `v0.3.4` has been re-released as `v0.4.0` due to breaking changes
47+
348
## v0.3.3
449

550
### [0.3.3](https://github.com/openfga/python-sdk/compare/v0.3.2...v0.3.3) (2024-01-02)

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.4
1+
0.4.0

example/example1/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ attrs==23.1.0
44
frozenlist==1.4.1
55
idna==3.6
66
multidict==6.0.4
7-
openfga-sdk==0.3.4
7+
openfga-sdk==0.4.0
88
python-dateutil==2.8.2
99
six==1.16.0
1010
urllib3==2.1.0

openfga_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT.
1515
"""
1616

17-
__version__ = "0.3.4"
17+
__version__ = "0.4.0"
1818

1919
from openfga_sdk.client.client import OpenFgaClient
2020
from openfga_sdk.client.configuration import ClientConfiguration

openfga_sdk/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from openfga_sdk.exceptions import ApiValueError, ApiException, FgaValidationException, RateLimitExceededError
3535

3636

37-
DEFAULT_USER_AGENT = 'openfga-sdk python/0.3.4'
37+
DEFAULT_USER_AGENT = 'openfga-sdk python/0.4.0'
3838

3939

4040
def random_time(loop_count, min_wait_in_ms):

openfga_sdk/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def to_debug_report(self):
440440
"OS: {env}\n"\
441441
"Python Version: {pyversion}\n"\
442442
"Version of the API: 0.1\n"\
443-
"SDK Package Version: 0.3.4".\
443+
"SDK Package Version: 0.4.0".\
444444
format(env=sys.platform, pyversion=sys.version)
445445

446446
def get_host_settings(self):

openfga_sdk/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def _obtain_token(self, client):
5454
'grant_type': "client_credentials",
5555
}
5656
headers = urllib3.response.HTTPHeaderDict(
57-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.3.4'})
57+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.4.0'})
5858
raw_response = await client.POST(token_url, headers=headers, body=body)
5959
if 200 <= raw_response.status <= 299:
6060
try:

openfga_sdk/sync/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from openfga_sdk.exceptions import ApiValueError, ApiException, FgaValidationException, RateLimitExceededError
3535

3636

37-
DEFAULT_USER_AGENT = 'openfga-sdk python/0.3.4'
37+
DEFAULT_USER_AGENT = 'openfga-sdk python/0.4.0'
3838

3939

4040
def random_time(loop_count, min_wait_in_ms):

openfga_sdk/sync/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _obtain_token(self, client):
5454
'grant_type': "client_credentials",
5555
}
5656
headers = urllib3.response.HTTPHeaderDict(
57-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.3.4'})
57+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.4.0'})
5858
raw_response = client.POST(token_url, headers=headers, body=body)
5959
if 200 <= raw_response.status <= 299:
6060
try:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from setuptools import setup, find_packages # noqa: H301
1616

1717
NAME = "openfga-sdk"
18-
VERSION = "0.3.4"
18+
VERSION = "0.4.0"
1919
# To install the library, run the following
2020
#
2121
# python setup.py install

0 commit comments

Comments
 (0)