From 00ac9c16b833d620bb443ba3a3cdd72bdebffba5 Mon Sep 17 00:00:00 2001 From: Raghd Hamzeh Date: Tue, 5 Sep 2023 07:46:18 -0400 Subject: [PATCH] release(v0.2.1): fix client check crash & update docs --- CHANGELOG.md | 6 ++++++ VERSION.txt | 2 +- openfga_sdk/__init__.py | 2 +- openfga_sdk/api_client.py | 2 +- openfga_sdk/configuration.py | 2 +- openfga_sdk/credentials.py | 2 +- setup.py | 2 +- test/test_credentials.py | 2 +- test/test_open_fga_api.py | 4 ++-- 9 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9450183..8b56c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.2.1 + +### [0.2.1](https://github.com/openfga/python-sdk/compare/v0.2.0...v0.2.1) (2023-09-05) +- fix(client): fix a crash when calling check with contextual tuples (https://github.com/openfga/python-sdk/commit/dded83f9a75dc1f01c1cfbd8385a25654129f78f) +- chore(docs): update README and fix a few typos (https://github.com/openfga/python-sdk/pull/21, https://github.com/openfga/python-sdk/pull/31, https://github.com/openfga/python-sdk/pull/32, https://github.com/openfga/python-sdk/pull/33, https://github.com/openfga/python-sdk/pull/34, https://github.com/openfga/python-sdk/pull/37) + ## v0.2.0 ### [0.2.0](https://github.com/openfga/python-sdk/compare/v0.1.1...v0.2.0) (2023-05-25) diff --git a/VERSION.txt b/VERSION.txt index 0ea3a94..0c62199 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.2.0 +0.2.1 diff --git a/openfga_sdk/__init__.py b/openfga_sdk/__init__.py index 2045c3a..27423f6 100644 --- a/openfga_sdk/__init__.py +++ b/openfga_sdk/__init__.py @@ -14,7 +14,7 @@ NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. """ -__version__ = "0.2.0" +__version__ = "0.2.1" from openfga_sdk.client.client import OpenFgaClient from openfga_sdk.client.configuration import ClientConfiguration diff --git a/openfga_sdk/api_client.py b/openfga_sdk/api_client.py index 8d0c355..1c59e6f 100644 --- a/openfga_sdk/api_client.py +++ b/openfga_sdk/api_client.py @@ -34,7 +34,7 @@ from openfga_sdk.exceptions import ApiValueError, ApiException, FgaValidationException, RateLimitExceededError -DEFAULT_USER_AGENT = 'openfga-sdk python/0.2.0' +DEFAULT_USER_AGENT = 'openfga-sdk python/0.2.1' def random_time(loop_count, min_wait_in_ms): diff --git a/openfga_sdk/configuration.py b/openfga_sdk/configuration.py index 98265e5..79b53d6 100644 --- a/openfga_sdk/configuration.py +++ b/openfga_sdk/configuration.py @@ -439,7 +439,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.1\n"\ - "SDK Package Version: 0.2.0".\ + "SDK Package Version: 0.2.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/openfga_sdk/credentials.py b/openfga_sdk/credentials.py index 9c45425..23cbf51 100644 --- a/openfga_sdk/credentials.py +++ b/openfga_sdk/credentials.py @@ -215,7 +215,7 @@ async def _obtain_token(self, client): 'grant_type': "client_credentials", } headers = urllib3.response.HTTPHeaderDict( - {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.0'}) + {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.1'}) raw_response = await client.POST(token_url, headers=headers, body=body) if 200 <= raw_response.status <= 299: try: diff --git a/setup.py b/setup.py index 73342e1..35fb139 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "openfga-sdk" -VERSION = "0.2.0" +VERSION = "0.2.1" # To install the library, run the following # # python setup.py install diff --git a/test/test_credentials.py b/test/test_credentials.py index 2952aa0..a7566e0 100644 --- a/test/test_credentials.py +++ b/test/test_credentials.py @@ -219,7 +219,7 @@ async def test_get_authentication_obtain_client_credentials(self, mock_request): self.assertGreaterEqual(credential._access_expiry_time, current_time + timedelta(seconds=int(120))) expected_header = urllib3.response.HTTPHeaderDict( - {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.0'}) + {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk (python) 0.2.1'}) mock_request.assert_called_once_with( 'POST', 'https://www.testme.com/oauth/token', diff --git a/test/test_open_fga_api.py b/test/test_open_fga_api.py index db48ebe..e952cc8 100644 --- a/test/test_open_fga_api.py +++ b/test/test_open_fga_api.py @@ -1174,7 +1174,7 @@ async def test_check_api_token(self, mock_request): self.assertTrue(api_response.allowed) # Make sure the API was called with the right data expectedHeader = urllib3.response.HTTPHeaderDict( - {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.0', 'Authorization': 'Bearer TOKEN1'}) + {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.1', 'Authorization': 'Bearer TOKEN1'}) mock_request.assert_called_once_with( 'POST', 'http://api.fga.example/stores/01H0H015178Y2V4CX10C2KGHF4/check', @@ -1217,7 +1217,7 @@ async def test_check_custom_header(self, mock_request): self.assertTrue(api_response.allowed) # Make sure the API was called with the right data expectedHeader = urllib3.response.HTTPHeaderDict( - {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.0', 'Custom Header': 'custom value'}) + {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'openfga-sdk python/0.2.1', 'Custom Header': 'custom value'}) mock_request.assert_called_once_with( 'POST', 'http://api.fga.example/stores/01H0H015178Y2V4CX10C2KGHF4/check',