Skip to content

Commit d35fef5

Browse files
committed
release: v0.2.0 - OpenFgaClient with batch_check, list_relations and more
1 parent 4c4fa23 commit d35fef5

File tree

9 files changed

+24
-9
lines changed

9 files changed

+24
-9
lines changed

CHANGELOG.md

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

3+
## v0.2.0
4+
5+
### [0.2.0](https://github.com/openfga/python-sdk/compare/v0.1.1...v0.2.0) (2023-05-25)
6+
7+
Changes:
8+
- [BREAKING] feat!: `schema_version` is now required when calling `write_authorization_model`
9+
- [BREAKING] chore!: drop support for python < 3.10
10+
- feat(client): add OpenFgaClient wrapper see [docs](https://github.com/openfga/python-sdk/tree/main#readme), see the `v0.1.1` docs for [the OpenFgaApi docs](https://github.com/openfga/python-sdk/tree/v0.1.1#readme)
11+
- feat(client): implement `batch_check` to check multiple tuples in parallel
12+
- feat(client): implement `list_relations` to check in one call whether a user has multiple relations to an objects
13+
- feat(client): add support for a non-transactional `write`
14+
- feat(validation): ensure storeId and authorizationModelId are in valid ulid format
15+
- chore(config): bump default max retries to `15`
16+
- chore(deps): upgrade dependencies
17+
318
## v0.1.1
419

520
### [0.1.1](https://github.com/openfga/python-sdk/compare/v0.1.0...v0.1.1) (2023-01-17)

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.1
1+
0.2.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.1.1"
17+
__version__ = "0.2.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
@@ -92,7 +92,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
9292
self.cookie = cookie
9393
# Set default User-Agent.
9494
self.user_agent = 'openfga-sdk {sdkId}/{packageVersion}'.replace(
95-
'{sdkId}', 'python').replace('{packageVersion}', '0.1.1')
95+
'{sdkId}', 'python').replace('{packageVersion}', '0.2.0')
9696
self.client_side_validation = configuration.client_side_validation
9797

9898
async def __aenter__(self):

openfga_sdk/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def to_debug_report(self):
439439
"OS: {env}\n"\
440440
"Python Version: {pyversion}\n"\
441441
"Version of the API: 0.1\n"\
442-
"SDK Package Version: 0.1.1".\
442+
"SDK Package Version: 0.2.0".\
443443
format(env=sys.platform, pyversion=sys.version)
444444

445445
def get_host_settings(self):

openfga_sdk/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ async def _obtain_token(self, client):
215215
'grant_type': "client_credentials",
216216
}
217217
headers = urllib3.response.HTTPHeaderDict(
218-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.1.1'})
218+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.0'})
219219
raw_response = await client.POST(token_url, headers=headers, body=body)
220220
if 200 <= raw_response.status <= 299:
221221
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.1.1"
18+
VERSION = "0.2.0"
1919
# To install the library, run the following
2020
#
2121
# python setup.py install

test/test_credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def test_get_authentication_obtain_client_credentials(self, mock_request):
219219
self.assertGreaterEqual(credential._access_expiry_time,
220220
current_time + timedelta(seconds=int(120)))
221221
expected_header = urllib3.response.HTTPHeaderDict(
222-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.1.1'})
222+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.0'})
223223
mock_request.assert_called_once_with(
224224
'POST',
225225
'https://www.testme.com/oauth/token',

test/test_open_fga_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ async def test_check_api_token(self, mock_request):
11741174
self.assertTrue(api_response.allowed)
11751175
# Make sure the API was called with the right data
11761176
expectedHeader = urllib3.response.HTTPHeaderDict(
1177-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.1.1', 'Authorization': 'Bearer TOKEN1'})
1177+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.0', 'Authorization': 'Bearer TOKEN1'})
11781178
mock_request.assert_called_once_with(
11791179
'POST',
11801180
'http://api.fga.example/stores/01H0H015178Y2V4CX10C2KGHF4/check',
@@ -1217,7 +1217,7 @@ async def test_check_custom_header(self, mock_request):
12171217
self.assertTrue(api_response.allowed)
12181218
# Make sure the API was called with the right data
12191219
expectedHeader = urllib3.response.HTTPHeaderDict(
1220-
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.1.1', 'Custom Header': 'custom value'})
1220+
{'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.0', 'Custom Header': 'custom value'})
12211221
mock_request.assert_called_once_with(
12221222
'POST',
12231223
'http://api.fga.example/stores/01H0H015178Y2V4CX10C2KGHF4/check',

0 commit comments

Comments
 (0)