From e00991548e4dedf46f3afa8685b1b0b7321786b8 Mon Sep 17 00:00:00 2001 From: dvacca-onfido <134616519+dvacca-onfido@users.noreply.github.com> Date: Wed, 22 Jan 2025 09:12:10 +0000 Subject: [PATCH] Upgrade after onfido-openapi-spec change 7887fd6 --- .release.json | 8 ++++---- README.md | 30 ++++++++++++++++-------------- onfido/__init__.py | 2 +- onfido/api_client.py | 2 +- onfido/configuration.py | 2 +- onfido/models/id_number.py | 4 ++-- poetry.lock | 30 +++++++++++++++--------------- pyproject.toml | 2 +- setup.py | 2 +- 9 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.release.json b/.release.json index e069290..5922901 100644 --- a/.release.json +++ b/.release.json @@ -1,9 +1,9 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "54ce45f", - "long_sha": "54ce45f2138f044cc5cb40f6904dc7bc1a675be6", - "version": "v4.5.0" + "short_sha": "7887fd6", + "long_sha": "7887fd62b32910e929d833c45f4393468e181a89", + "version": "v4.6.0" }, - "release": "v4.5.0" + "release": "v4.6.0" } diff --git a/README.md b/README.md index 123b4e9..db58a34 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ The official Python library for integrating with the Onfido API. -Documentation can be found at . +Documentation is available at . -This version uses Onfido API v3.6. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API. +This version uses Onfido API v3.6. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details. It explains which client library versions use which versions of the API. [![PyPI version](https://badge.fury.io/py/onfido-python.svg)](https://badge.fury.io/py/onfido-python) ![Build Status](https://github.com/onfido/onfido-python/actions/workflows/python.yml/badge.svg) @@ -19,7 +19,7 @@ Python 3.7+ #### Pip -If the python package is hosted on a repository, you can install directly using: +If the Python package is hosted on a repository, you can install it directly using: ```sh pip install onfido-python @@ -68,7 +68,7 @@ with onfido.ApiClient(configuration) as api_client: ... ``` -NB: by default, timeout values are set to 30 seconds. +NB: by default, timeout values are set to 30 seconds. You can change the default timeout values by setting the `timeout` parameter in the `Configuration` object, as shown in the example above. ### Making a call to the API @@ -97,7 +97,7 @@ Specific exception types are defined into [exceptions.py](onfido/exceptions.py). ### Webhook event verification -Webhook events payload needs to be verified before it can be accessed. Library allows to easily decode the payload and verify its signature before returning it as an object for user convenience: +Webhook events payload needs to be verified before it can be accessed. Verifying webhook payloads is crucial for security reasons, as it ensures that the payloads are indeed from Onfido and have not been tampered with. The library allows you to easily decode the payload and verify its signature before returning it as an object for user convenience: ```python try: @@ -115,41 +115,43 @@ Webhook events payload needs to be verified before it can be accessed. Library a #### Do not use additional properties -Retain from using `additional_properties` dictionary to access not defined properties to avoid breaking changes when these fields will appear. +Except for accessing Task object's outputs, avoid using the `additional_properties` dictionary to access undefined properties to prevent breaking changes when these fields appear. ## Contributing -This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. +This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository. For contributions to the tests instead, please follow the steps below: -1. [Fork](https://github.com/onfido/onfido-python/fork) repository +1. Fork the [repository](https://github.com/onfido/onfido-python/fork) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Make your changes -4. Commit your changes (`git commit -am 'Add some feature'`) +4. Commit your changes (`git commit -am 'Add detailed description of the feature'`) 5. Push to the branch (`git push origin my-new-feature`) 6. Create a new Pull Request ## Versioning policy -[Semantic Versioning](https://semver.org) policy is used for library versioning, following guidelines and limitations below: +Versioning helps manage changes and ensures compatibility across different versions of the library. -- MAJOR versions (x.0.0) might: +[Semantic Versioning](https://semver.org) policy is used for library versioning, following the guidelines and limitations outlined below: + +- MAJOR versions (x.0.0) may: - target a new API version - include non-backward compatible change -- MINOR versions (0.x.0) might: +- MINOR versions (0.x.0) may: - add a new functionality, non-mandatory parameter or property - deprecate an old functionality - include non-backward compatible change to a functionality which is: - labelled as alpha or beta - completely broken and not usable -- PATCH version (0.0.x) might: +- PATCH version (0.0.x) will: - fix a bug - include backward compatible changes only ## More documentation -More documentation and code examples can be found at . +Additional documentation and code examples can be found at . ## Support diff --git a/onfido/__init__.py b/onfido/__init__.py index bfbff50..7c59a67 100644 --- a/onfido/__init__.py +++ b/onfido/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "4.5.0" +__version__ = "4.6.0" # import apis into sdk package from onfido.api.default_api import DefaultApi diff --git a/onfido/api_client.py b/onfido/api_client.py index 207872a..6ae005d 100644 --- a/onfido/api_client.py +++ b/onfido/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'onfido-python/4.5.0' + self.user_agent = 'onfido-python/4.6.0' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/onfido/configuration.py b/onfido/configuration.py index 1b5ffdb..0a3a9c8 100644 --- a/onfido/configuration.py +++ b/onfido/configuration.py @@ -394,7 +394,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v3.6\n"\ - "SDK Package Version: 4.5.0".\ + "SDK Package Version: 4.6.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onfido/models/id_number.py b/onfido/models/id_number.py index 33e74f9..6cf0ae9 100644 --- a/onfido/models/id_number.py +++ b/onfido/models/id_number.py @@ -38,8 +38,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other']): - raise ValueError("must be one of enum values ('ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other')") + if value not in set(['ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other']): + raise ValueError("must be one of enum values ('ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other')") return value model_config = ConfigDict( diff --git a/poetry.lock b/poetry.lock index 730d67c..1f3acee 100644 --- a/poetry.lock +++ b/poetry.lock @@ -16,13 +16,13 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} [[package]] name = "cachetools" -version = "5.5.0" +version = "5.5.1" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" files = [ - {file = "cachetools-5.5.0-py3-none-any.whl", hash = "sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292"}, - {file = "cachetools-5.5.0.tar.gz", hash = "sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a"}, + {file = "cachetools-5.5.1-py3-none-any.whl", hash = "sha256:b76651fdc3b24ead3c648bbdeeb940c1b04d365b38b4af66788f9ec4a81d42bb"}, + {file = "cachetools-5.5.1.tar.gz", hash = "sha256:70f238fbba50383ef62e55c6aff6d9673175fe59f7c6782c7a0b9e38f4a9df95"}, ] [[package]] @@ -338,13 +338,13 @@ files = [ [[package]] name = "pydantic" -version = "2.10.4" +version = "2.10.5" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.10.4-py3-none-any.whl", hash = "sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d"}, - {file = "pydantic-2.10.4.tar.gz", hash = "sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06"}, + {file = "pydantic-2.10.5-py3-none-any.whl", hash = "sha256:4dd4e322dbe55472cb7ca7e73f4b63574eecccf2835ffa2af9021ce113c83c53"}, + {file = "pydantic-2.10.5.tar.gz", hash = "sha256:278b38dbbaec562011d659ee05f63346951b3a248a6f3642e1bc68894ea2b4ff"}, ] [package.dependencies] @@ -606,13 +606,13 @@ files = [ [[package]] name = "tox" -version = "4.23.2" +version = "4.24.1" description = "tox is a generic virtualenv management and test command line tool" optional = false python-versions = ">=3.8" files = [ - {file = "tox-4.23.2-py3-none-any.whl", hash = "sha256:452bc32bb031f2282881a2118923176445bac783ab97c874b8770ab4c3b76c38"}, - {file = "tox-4.23.2.tar.gz", hash = "sha256:86075e00e555df6e82e74cfc333917f91ecb47ffbc868dcafbd2672e332f4a2c"}, + {file = "tox-4.24.1-py3-none-any.whl", hash = "sha256:57ba7df7d199002c6df8c2db9e6484f3de6ca8f42013c083ea2d4d1e5c6bdc75"}, + {file = "tox-4.24.1.tar.gz", hash = "sha256:083a720adbc6166fff0b7d1df9d154f9d00bfccb9403b8abf6bc0ee435d6a62e"}, ] [package.dependencies] @@ -620,13 +620,13 @@ cachetools = ">=5.5" chardet = ">=5.2" colorama = ">=0.4.6" filelock = ">=3.16.1" -packaging = ">=24.1" +packaging = ">=24.2" platformdirs = ">=4.3.6" pluggy = ">=1.5" pyproject-api = ">=1.8" -tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} +tomli = {version = ">=2.1", markers = "python_version < \"3.11\""} typing-extensions = {version = ">=4.12.2", markers = "python_version < \"3.11\""} -virtualenv = ">=20.26.6" +virtualenv = ">=20.27.1" [package.extras] test = ["devpi-process (>=1.0.2)", "pytest (>=8.3.3)", "pytest-mock (>=3.14)"] @@ -672,13 +672,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.28.1" +version = "20.29.1" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" files = [ - {file = "virtualenv-20.28.1-py3-none-any.whl", hash = "sha256:412773c85d4dab0409b83ec36f7a6499e72eaf08c80e81e9576bca61831c71cb"}, - {file = "virtualenv-20.28.1.tar.gz", hash = "sha256:5d34ab240fdb5d21549b76f9e8ff3af28252f5499fb6d6f031adac4e5a8c5329"}, + {file = "virtualenv-20.29.1-py3-none-any.whl", hash = "sha256:4e4cb403c0b0da39e13b46b1b2476e505cb0046b25f242bee80f62bf990b2779"}, + {file = "virtualenv-20.29.1.tar.gz", hash = "sha256:b8b8970138d32fb606192cb97f6cd4bb644fa486be9308fb9b63f81091b5dc35"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 20d3319..422cb03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "onfido-python" -version = "4.5.0" +version = "4.6.0" description = "Python library for the Onfido API" authors = ["OpenAPI Generator Community "] license = "MIT" diff --git a/setup.py b/setup.py index 68342eb..e713524 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "onfido-python" -VERSION = "4.5.0" +VERSION = "4.6.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0",