Skip to content

Commit

Permalink
Merge pull request #77 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-python after onfido-openapi-spec update (964fb43)
  • Loading branch information
dvacca-onfido authored Dec 20, 2024
2 parents fc4dc99 + 54de55a commit 3ed2ff0
Show file tree
Hide file tree
Showing 15 changed files with 534 additions and 137 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": "8c793a1",
"long_sha": "8c793a1c8307dcd92fa657edb2a1e9b184c15278",
"version": "v4.3.0"
"short_sha": "964fb43",
"long_sha": "964fb43a1bf211197ef7a45c230771b8ba561b3c",
"version": "v4.4.0"
},
"release": "v4.3.0"
"release": "v4.4.0"
}
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.3.0"
__version__ = "4.4.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.3.0'
self.user_agent = 'onfido-python/4.4.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.3.0".\
"SDK Package Version: 4.4.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
2 changes: 1 addition & 1 deletion onfido/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Task(BaseModel):
task_def_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The identifier for the Task Definition.")
task_def_version: Optional[StrictStr] = Field(default=None, description="The task definition version.")
input: Optional[Dict[str, Any]] = Field(default=None, description="Input object with the fields used by the Task to execute.")
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object with the fields produced by the Task execution.")
output: Any = Field(default=None, description="Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.")
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Task was created.")
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Task was last updated.")
additional_properties: Dict[str, Any] = {}
Expand Down
2 changes: 1 addition & 1 deletion onfido/models/webhook_event_payload_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WebhookEventPayloadResource(BaseModel):
task_def_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The identifier for the Task Definition.")
task_def_version: Optional[StrictStr] = Field(default=None, description="The task definition version.")
input: Optional[Dict[str, Any]] = Field(default=None, description="Input object with the fields used by the Task execution.")
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object with the fields produced by the Task execution.")
output: Any = Field(default=None, description="Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.")
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.")
Expand Down
2 changes: 2 additions & 0 deletions onfido/models/webhook_event_resource_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class WebhookEventResourceType(str, Enum):
WORKFLOW_RUN = 'workflow_run'
WORKFLOW_TASK = 'workflow_task'
WATCHLIST_MONITOR = 'watchlist_monitor'
WORKFLOW_TIMELINE_FILE = 'workflow_timeline_file'
WORKFLOW_RUN_EVIDENCE_FOLDER = 'workflow_run_evidence_folder'

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
1 change: 1 addition & 0 deletions onfido/models/webhook_event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class WebhookEventType(str, Enum):
REPORT_DOT_COMPLETED = 'report.completed'
WORKFLOW_TIMELINE_FILE_DOT_CREATED = 'workflow_timeline_file.created'
WORKFLOW_SIGNED_EVIDENCE_FILE_DOT_CREATED = 'workflow_signed_evidence_file.created'
WORKFLOW_RUN_EVIDENCE_FOLDER_DOT_CREATED = 'workflow_run_evidence_folder.created'

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
266 changes: 148 additions & 118 deletions poetry.lock

Large diffs are not rendered by default.

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.3.0"
version = "4.4.0"
description = "Python library for the Onfido API"
authors = ["OpenAPI Generator Community <[email protected]>"]
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.3.0"
VERSION = "4.4.0"
PYTHON_REQUIRES = ">= 3.8"
REQUIRES = [
"urllib3 >= 1.25.3, < 3.0.0",
Expand Down
31 changes: 31 additions & 0 deletions tests/media/studio_webhook_event_with_list_in_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"payload": {
"resource_type": "workflow_task",
"action": "workflow_task.completed",
"object": {
"id": "document_photo_5c229",
"task_spec_id": "document_photo_5c229",
"task_def_id": "upload_document_photo",
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"status": "completed",
"completed_at_iso8601": "2024-12-18T18:13:10Z",
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_photo_5c229"
},
"resource": {
"updated_at": "2024-12-18T18:13:10Z",
"output": [
{
"type": "document_photo",
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU="
}
],
"created_at": "2024-12-18T18:12:44Z",
"task_def_id": "upload_document_photo",
"input": {},
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"task_def_version": null,
"id": "document_photo_5c229"
}
}
}
264 changes: 264 additions & 0 deletions tests/media/studio_webhook_event_with_object_in_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
{
"payload": {
"resource_type": "workflow_task",
"action": "workflow_task.completed",
"object": {
"id": "document_check_75329",
"task_spec_id": "document_check_75329",
"task_def_id": "document_check",
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"status": "completed",
"completed_at_iso8601": "2024-12-18T18:13:13Z",
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_check_75329"
},
"resource": {
"task_def_version": null,
"task_def_id": "document_check",
"updated_at": "2024-12-18T18:13:13Z",
"id": "document_check_75329",
"output": {
"status": "complete",
"result": "clear",
"sub_result": "clear",
"uuid": "95c8cc09-db72-42ff-85ef-ee6c82020a24",
"properties": {
"date_of_birth": "1990-01-01",
"date_of_expiry": "2031-05-28",
"document_numbers": [
{
"type": "document_number",
"value": "999999999"
}
],
"document_type": "passport",
"first_name": "Jane",
"issuing_country": "GBR",
"last_name": "Doe",
"document_number": "999999999"
},
"breakdown": {
"data_validation": {
"result": "clear",
"breakdown": {
"mrz": {
"result": "clear",
"properties": {}
},
"expiry_date": {
"result": "clear",
"properties": {}
},
"document_expiration": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"date_of_birth": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
}
}
},
"visual_authenticity": {
"result": "clear",
"breakdown": {
"face_detection": {
"result": "clear",
"properties": {}
},
"other": {
"result": "clear",
"properties": {}
},
"digital_tampering": {
"result": "clear",
"properties": {}
},
"original_document_present": {
"result": "clear",
"properties": {}
},
"security_features": {
"result": "clear",
"properties": {}
},
"template": {
"result": "clear",
"properties": {}
},
"picture_face_integrity": {
"result": "clear",
"properties": {}
},
"fonts": {
"result": "clear",
"properties": {}
}
}
},
"compromised_document": {
"result": "clear",
"breakdown": {
"repeat_attempts": {
"result": "clear",
"properties": {}
},
"document_database": {
"result": "clear",
"properties": {}
}
}
},
"data_consistency": {
"result": "clear",
"breakdown": {
"nationality": {
"result": "clear",
"properties": {}
},
"last_name": {
"result": "clear",
"properties": {}
},
"first_name": {
"result": "clear",
"properties": {}
},
"multiple_data_sources_present": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
},
"date_of_birth": {
"result": "clear",
"properties": {}
},
"document_type": {
"result": "clear",
"properties": {}
},
"issuing_country": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"date_of_expiry": {
"result": "clear",
"properties": {}
}
}
},
"data_comparison": {
"result": "clear",
"breakdown": {
"date_of_birth": {
"result": "clear",
"properties": {}
},
"first_name": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"document_type": {
"result": "clear",
"properties": {}
},
"last_name": {
"result": "clear",
"properties": {}
},
"date_of_expiry": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
},
"issuing_country": {
"result": "clear",
"properties": {}
}
}
},
"image_integrity": {
"result": "clear",
"breakdown": {
"colour_picture": {
"result": "clear",
"properties": {}
},
"supported_document": {
"result": "clear",
"properties": {}
},
"conclusive_document_quality": {
"result": "clear",
"properties": {}
},
"image_quality": {
"result": "clear",
"properties": {}
}
}
},
"police_record": {
"result": "clear",
"breakdown": {
"document_has_not_been_recorded_as_lost,_stolen_or_compromised": {
"result": "clear",
"properties": {}
}
}
},
"age_validation": {
"result": "clear",
"breakdown": {
"minimum_accepted_age": {
"result": "clear",
"properties": {}
}
}
}
},
"repeat_attempts": {
"report_id": "00000000-0000-0000-0000-000000000000",
"repeat_attempts": [],
"attempts_count": 1,
"attempts_clear_rate": 0,
"unique_mismatches_count": 0
}
},
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"input": {
"document_ids": [
{
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU=",
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
"type": "document_photo"
}
],
"first_name": "Jane",
"last_name": "Doe"
},
"created_at": "2024-12-18T18:13:11Z"
}
}
}
Loading

0 comments on commit 3ed2ff0

Please sign in to comment.