Skip to content

Commit

Permalink
Merge pull request #80 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-python after onfido-openapi-spec update (be823e7)
  • Loading branch information
dvacca-onfido authored Jan 24, 2025
2 parents de610dd + 295c124 commit 4b3e459
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 42 deletions.
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -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": "be823e7",
"long_sha": "be823e7815c93bfbfc3fb764c0548f57cb851fe9",
"version": "v4.6.0"
},
"release": "v4.5.0"
"release": "v4.6.0"
}
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

The official Python library for integrating with the Onfido API.

Documentation can be found at <https://documentation.onfido.com>.
Documentation is available at <https://documentation.onfido.com>.

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)
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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 <https://documentation.onfido.com>.
Additional documentation and code examples can be found at <https://documentation.onfido.com>.

## Support

Expand Down
2 changes: 1 addition & 1 deletion onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion onfido/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion onfido/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions onfido/models/id_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions onfido/models/webhook_event_payload_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ class WebhookEventPayloadResource(BaseModel):
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version.")
link: Optional[WorkflowRunLink] = Field(default=None, description="Object for the configuration of the Workflow Run link.")
error: Optional[WorkflowRunError] = Field(default=None, description="Error object that details why a Workflow Run is in Error status.")
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "applicant_id", "created_at", "updated_at", "dashboard_url", "workflow_id", "workflow_run_id", "workflow_version_id", "task_def_id", "task_def_version", "input", "output", "reasons", "link", "error"]
__properties: ClassVar[List[str]] = ["id", "applicant_id", "created_at", "updated_at", "dashboard_url", "workflow_id", "workflow_run_id", "workflow_version_id", "task_def_id", "task_def_version", "input", "output", "reasons", "link", "error", "customer_user_id"]

@field_validator('task_def_id')
def task_def_id_validate_regular_expression(cls, value):
Expand Down Expand Up @@ -146,7 +147,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"output": obj.get("output"),
"reasons": obj.get("reasons"),
"link": WorkflowRunLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
"error": WorkflowRunError.from_dict(obj["error"]) if obj.get("error") is not None else None
"error": WorkflowRunError.from_dict(obj["error"]) if obj.get("error") is not None else None,
"customer_user_id": obj.get("customer_user_id")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <team@openapitools.org>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4b3e459

Please sign in to comment.