onfido-python 3.1.0__py3-none-any.whl → 3.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
onfido/__init__.py CHANGED
@@ -14,7 +14,7 @@
14
14
  """ # noqa: E501
15
15
 
16
16
 
17
- __version__ = "3.1.0"
17
+ __version__ = "3.3.0"
18
18
 
19
19
  # import apis into sdk package
20
20
  from onfido.api.default_api import DefaultApi
onfido/api/default_api.py CHANGED
@@ -5359,6 +5359,287 @@ class DefaultApi:
5359
5359
 
5360
5360
 
5361
5361
 
5362
+ @validate_call
5363
+ def download_qes_document(
5364
+ self,
5365
+ workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
5366
+ file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
5367
+ _request_timeout: Union[
5368
+ None,
5369
+ Annotated[StrictFloat, Field(gt=0)],
5370
+ Tuple[
5371
+ Annotated[StrictFloat, Field(gt=0)],
5372
+ Annotated[StrictFloat, Field(gt=0)]
5373
+ ]
5374
+ ] = None,
5375
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
5376
+ _content_type: Optional[StrictStr] = None,
5377
+ _headers: Optional[Dict[StrictStr, Any]] = None,
5378
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
5379
+ ) -> bytearray:
5380
+ """Retrieves the signed document or application form
5381
+
5382
+ Retrieves the signed document or application form depending on the file_id provided.
5383
+
5384
+ :param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
5385
+ :type workflow_run_id: str
5386
+ :param file_id: The unique identifier of the file which you want to retrieve. (required)
5387
+ :type file_id: str
5388
+ :param _request_timeout: timeout setting for this request. If one
5389
+ number provided, it will be total request
5390
+ timeout. It can also be a pair (tuple) of
5391
+ (connection, read) timeouts.
5392
+ :type _request_timeout: int, tuple(int, int), optional
5393
+ :param _request_auth: set to override the auth_settings for an a single
5394
+ request; this effectively ignores the
5395
+ authentication in the spec for a single request.
5396
+ :type _request_auth: dict, optional
5397
+ :param _content_type: force content-type for the request.
5398
+ :type _content_type: str, Optional
5399
+ :param _headers: set to override the headers for a single
5400
+ request; this effectively ignores the headers
5401
+ in the spec for a single request.
5402
+ :type _headers: dict, optional
5403
+ :param _host_index: set to override the host_index for a single
5404
+ request; this effectively ignores the host_index
5405
+ in the spec for a single request.
5406
+ :type _host_index: int, optional
5407
+ :return: Returns the result object.
5408
+ """ # noqa: E501
5409
+
5410
+ _param = self._download_qes_document_serialize(
5411
+ workflow_run_id=workflow_run_id,
5412
+ file_id=file_id,
5413
+ _request_auth=_request_auth,
5414
+ _content_type=_content_type,
5415
+ _headers=_headers,
5416
+ _host_index=_host_index
5417
+ )
5418
+
5419
+ _response_types_map: Dict[str, Optional[str]] = {
5420
+ '302': None,
5421
+ '200': "bytearray",
5422
+ }
5423
+ response_data = self.api_client.call_api(
5424
+ *_param,
5425
+ _request_timeout=_request_timeout
5426
+ )
5427
+ response_data.read()
5428
+ return self.api_client.response_deserialize(
5429
+ response_data=response_data,
5430
+ response_types_map=_response_types_map,
5431
+ ).data
5432
+
5433
+
5434
+ @validate_call
5435
+ def download_qes_document_with_http_info(
5436
+ self,
5437
+ workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
5438
+ file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
5439
+ _request_timeout: Union[
5440
+ None,
5441
+ Annotated[StrictFloat, Field(gt=0)],
5442
+ Tuple[
5443
+ Annotated[StrictFloat, Field(gt=0)],
5444
+ Annotated[StrictFloat, Field(gt=0)]
5445
+ ]
5446
+ ] = None,
5447
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
5448
+ _content_type: Optional[StrictStr] = None,
5449
+ _headers: Optional[Dict[StrictStr, Any]] = None,
5450
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
5451
+ ) -> ApiResponse[bytearray]:
5452
+ """Retrieves the signed document or application form
5453
+
5454
+ Retrieves the signed document or application form depending on the file_id provided.
5455
+
5456
+ :param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
5457
+ :type workflow_run_id: str
5458
+ :param file_id: The unique identifier of the file which you want to retrieve. (required)
5459
+ :type file_id: str
5460
+ :param _request_timeout: timeout setting for this request. If one
5461
+ number provided, it will be total request
5462
+ timeout. It can also be a pair (tuple) of
5463
+ (connection, read) timeouts.
5464
+ :type _request_timeout: int, tuple(int, int), optional
5465
+ :param _request_auth: set to override the auth_settings for an a single
5466
+ request; this effectively ignores the
5467
+ authentication in the spec for a single request.
5468
+ :type _request_auth: dict, optional
5469
+ :param _content_type: force content-type for the request.
5470
+ :type _content_type: str, Optional
5471
+ :param _headers: set to override the headers for a single
5472
+ request; this effectively ignores the headers
5473
+ in the spec for a single request.
5474
+ :type _headers: dict, optional
5475
+ :param _host_index: set to override the host_index for a single
5476
+ request; this effectively ignores the host_index
5477
+ in the spec for a single request.
5478
+ :type _host_index: int, optional
5479
+ :return: Returns the result object.
5480
+ """ # noqa: E501
5481
+
5482
+ _param = self._download_qes_document_serialize(
5483
+ workflow_run_id=workflow_run_id,
5484
+ file_id=file_id,
5485
+ _request_auth=_request_auth,
5486
+ _content_type=_content_type,
5487
+ _headers=_headers,
5488
+ _host_index=_host_index
5489
+ )
5490
+
5491
+ _response_types_map: Dict[str, Optional[str]] = {
5492
+ '302': None,
5493
+ '200': "bytearray",
5494
+ }
5495
+ response_data = self.api_client.call_api(
5496
+ *_param,
5497
+ _request_timeout=_request_timeout
5498
+ )
5499
+ response_data.read()
5500
+ return self.api_client.response_deserialize(
5501
+ response_data=response_data,
5502
+ response_types_map=_response_types_map,
5503
+ )
5504
+
5505
+
5506
+ @validate_call
5507
+ def download_qes_document_without_preload_content(
5508
+ self,
5509
+ workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
5510
+ file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
5511
+ _request_timeout: Union[
5512
+ None,
5513
+ Annotated[StrictFloat, Field(gt=0)],
5514
+ Tuple[
5515
+ Annotated[StrictFloat, Field(gt=0)],
5516
+ Annotated[StrictFloat, Field(gt=0)]
5517
+ ]
5518
+ ] = None,
5519
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
5520
+ _content_type: Optional[StrictStr] = None,
5521
+ _headers: Optional[Dict[StrictStr, Any]] = None,
5522
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
5523
+ ) -> RESTResponseType:
5524
+ """Retrieves the signed document or application form
5525
+
5526
+ Retrieves the signed document or application form depending on the file_id provided.
5527
+
5528
+ :param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
5529
+ :type workflow_run_id: str
5530
+ :param file_id: The unique identifier of the file which you want to retrieve. (required)
5531
+ :type file_id: str
5532
+ :param _request_timeout: timeout setting for this request. If one
5533
+ number provided, it will be total request
5534
+ timeout. It can also be a pair (tuple) of
5535
+ (connection, read) timeouts.
5536
+ :type _request_timeout: int, tuple(int, int), optional
5537
+ :param _request_auth: set to override the auth_settings for an a single
5538
+ request; this effectively ignores the
5539
+ authentication in the spec for a single request.
5540
+ :type _request_auth: dict, optional
5541
+ :param _content_type: force content-type for the request.
5542
+ :type _content_type: str, Optional
5543
+ :param _headers: set to override the headers for a single
5544
+ request; this effectively ignores the headers
5545
+ in the spec for a single request.
5546
+ :type _headers: dict, optional
5547
+ :param _host_index: set to override the host_index for a single
5548
+ request; this effectively ignores the host_index
5549
+ in the spec for a single request.
5550
+ :type _host_index: int, optional
5551
+ :return: Returns the result object.
5552
+ """ # noqa: E501
5553
+
5554
+ _param = self._download_qes_document_serialize(
5555
+ workflow_run_id=workflow_run_id,
5556
+ file_id=file_id,
5557
+ _request_auth=_request_auth,
5558
+ _content_type=_content_type,
5559
+ _headers=_headers,
5560
+ _host_index=_host_index
5561
+ )
5562
+
5563
+ _response_types_map: Dict[str, Optional[str]] = {
5564
+ '302': None,
5565
+ '200': "bytearray",
5566
+ }
5567
+ response_data = self.api_client.call_api(
5568
+ *_param,
5569
+ _request_timeout=_request_timeout
5570
+ )
5571
+ return response_data.response
5572
+
5573
+
5574
+ def _download_qes_document_serialize(
5575
+ self,
5576
+ workflow_run_id,
5577
+ file_id,
5578
+ _request_auth,
5579
+ _content_type,
5580
+ _headers,
5581
+ _host_index,
5582
+ ) -> RequestSerialized:
5583
+
5584
+ _host = None
5585
+
5586
+ _collection_formats: Dict[str, str] = {
5587
+ }
5588
+
5589
+ _path_params: Dict[str, str] = {}
5590
+ _query_params: List[Tuple[str, str]] = []
5591
+ _header_params: Dict[str, Optional[str]] = _headers or {}
5592
+ _form_params: List[Tuple[str, str]] = []
5593
+ _files: Dict[str, Union[str, bytes]] = {}
5594
+ _body_params: Optional[bytes] = None
5595
+
5596
+ # process the path parameters
5597
+ # process the query parameters
5598
+ if workflow_run_id is not None:
5599
+
5600
+ _query_params.append(('workflow_run_id', workflow_run_id))
5601
+
5602
+ if file_id is not None:
5603
+
5604
+ _query_params.append(('file_id', file_id))
5605
+
5606
+ # process the header parameters
5607
+ # process the form parameters
5608
+ # process the body parameter
5609
+
5610
+
5611
+ # set the HTTP header `Accept`
5612
+ _header_params['Accept'] = self.api_client.select_header_accept(
5613
+ [
5614
+ 'application/pdf',
5615
+ 'application/json'
5616
+ ]
5617
+ )
5618
+
5619
+
5620
+ # authentication setting
5621
+ _auth_settings: List[str] = [
5622
+ 'Token'
5623
+ ]
5624
+
5625
+ return self.api_client.param_serialize(
5626
+ method='GET',
5627
+ resource_path='/qualified_electronic_signature/documents',
5628
+ path_params=_path_params,
5629
+ query_params=_query_params,
5630
+ header_params=_header_params,
5631
+ body=_body_params,
5632
+ post_params=_form_params,
5633
+ files=_files,
5634
+ auth_settings=_auth_settings,
5635
+ collection_formats=_collection_formats,
5636
+ _host=_host,
5637
+ _request_auth=_request_auth
5638
+ )
5639
+
5640
+
5641
+
5642
+
5362
5643
  @validate_call
5363
5644
  def download_signed_evidence_file(
5364
5645
  self,
onfido/api_client.py CHANGED
@@ -88,7 +88,7 @@ class ApiClient:
88
88
  self.default_headers[header_name] = header_value
89
89
  self.cookie = cookie
90
90
  # Set default User-Agent.
91
- self.user_agent = 'onfido-python/3.1.0'
91
+ self.user_agent = 'onfido-python/3.3.0'
92
92
  self.client_side_validation = configuration.client_side_validation
93
93
 
94
94
  def __enter__(self):
onfido/configuration.py CHANGED
@@ -383,7 +383,7 @@ conf = onfido.Configuration(
383
383
  "OS: {env}\n"\
384
384
  "Python Version: {pyversion}\n"\
385
385
  "Version of the API: v3.6\n"\
386
- "SDK Package Version: 3.1.0".\
386
+ "SDK Package Version: 3.3.0".\
387
387
  format(env=sys.platform, pyversion=sys.version)
388
388
 
389
389
  def get_host_settings(self):
onfido/models/document.py CHANGED
@@ -48,8 +48,8 @@ class Document(BaseModel):
48
48
  if value is None:
49
49
  return value
50
50
 
51
- if value not in set(['jpg', 'png', 'pdf']):
52
- raise ValueError("must be one of enum values ('jpg', 'png', 'pdf')")
51
+ if value not in set(['jpg', 'jpeg', 'png', 'pdf']):
52
+ raise ValueError("must be one of enum values ('jpg', 'jpeg', 'png', 'pdf')")
53
53
  return value
54
54
 
55
55
  @field_validator('side')
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import date
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.document_properties_address_lines import DocumentPropertiesAddressLines
24
24
  from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
@@ -36,12 +36,14 @@ class DocumentProperties(BaseModel):
36
36
  """ # noqa: E501
37
37
  date_of_birth: Optional[date] = None
38
38
  date_of_expiry: Optional[date] = None
39
+ personal_number: Optional[StrictStr] = None
39
40
  document_numbers: Optional[List[DocumentPropertiesDocumentNumbersInner]] = None
40
41
  document_type: Optional[StrictStr] = None
41
42
  first_name: Optional[StrictStr] = None
43
+ middle_name: Optional[StrictStr] = None
44
+ last_name: Optional[StrictStr] = None
42
45
  gender: Optional[StrictStr] = None
43
46
  issuing_country: Optional[StrictStr] = None
44
- last_name: Optional[StrictStr] = None
45
47
  nationality: Optional[StrictStr] = None
46
48
  issuing_state: Optional[StrictStr] = None
47
49
  issuing_date: Optional[date] = None
@@ -55,7 +57,22 @@ class DocumentProperties(BaseModel):
55
57
  widow_name: Optional[StrictStr] = None
56
58
  alias_name: Optional[StrictStr] = None
57
59
  issuing_authority: Optional[StrictStr] = None
60
+ remarks: Optional[StrictStr] = None
61
+ civil_state: Optional[StrictStr] = None
62
+ expatriation: Optional[StrictStr] = None
63
+ father_name: Optional[StrictStr] = None
64
+ mother_name: Optional[StrictStr] = None
65
+ religion: Optional[StrictStr] = None
66
+ type_of_permit: Optional[StrictStr] = None
67
+ version_number: Optional[StrictStr] = None
68
+ document_subtype: Optional[StrictStr] = None
69
+ profession: Optional[StrictStr] = None
70
+ security_document_number: Optional[StrictStr] = None
71
+ tax_number: Optional[StrictStr] = None
72
+ nist_identity_evidence_strength: Optional[StrictStr] = None
73
+ has_issuance_confirmation: Optional[StrictStr] = None
58
74
  real_id_compliance: Optional[StrictBool] = None
75
+ security_tier: Optional[StrictStr] = None
59
76
  address_lines: Optional[DocumentPropertiesAddressLines] = None
60
77
  barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
61
78
  nfc: Optional[DocumentPropertiesNfc] = None
@@ -63,7 +80,37 @@ class DocumentProperties(BaseModel):
63
80
  document_classification: Optional[DocumentPropertiesDocumentClassification] = None
64
81
  extracted_data: Optional[DocumentPropertiesExtractedData] = None
65
82
  additional_properties: Dict[str, Any] = {}
66
- __properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "document_numbers", "document_type", "first_name", "gender", "issuing_country", "last_name", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "real_id_compliance", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data"]
83
+ __properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "personal_number", "document_numbers", "document_type", "first_name", "middle_name", "last_name", "gender", "issuing_country", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "remarks", "civil_state", "expatriation", "father_name", "mother_name", "religion", "type_of_permit", "version_number", "document_subtype", "profession", "security_document_number", "tax_number", "nist_identity_evidence_strength", "has_issuance_confirmation", "real_id_compliance", "security_tier", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data"]
84
+
85
+ @field_validator('nist_identity_evidence_strength')
86
+ def nist_identity_evidence_strength_validate_enum(cls, value):
87
+ """Validates the enum"""
88
+ if value is None:
89
+ return value
90
+
91
+ if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength']):
92
+ raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength')")
93
+ return value
94
+
95
+ @field_validator('has_issuance_confirmation')
96
+ def has_issuance_confirmation_validate_enum(cls, value):
97
+ """Validates the enum"""
98
+ if value is None:
99
+ return value
100
+
101
+ if value not in set(['true', 'false', 'unspecified']):
102
+ raise ValueError("must be one of enum values ('true', 'false', 'unspecified')")
103
+ return value
104
+
105
+ @field_validator('security_tier')
106
+ def security_tier_validate_enum(cls, value):
107
+ """Validates the enum"""
108
+ if value is None:
109
+ return value
110
+
111
+ if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier']):
112
+ raise ValueError("must be one of enum values ('tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier')")
113
+ return value
67
114
 
68
115
  model_config = ConfigDict(
69
116
  populate_by_name=True,
@@ -154,12 +201,14 @@ class DocumentProperties(BaseModel):
154
201
  _obj = cls.model_validate({
155
202
  "date_of_birth": obj.get("date_of_birth"),
156
203
  "date_of_expiry": obj.get("date_of_expiry"),
204
+ "personal_number": obj.get("personal_number"),
157
205
  "document_numbers": [DocumentPropertiesDocumentNumbersInner.from_dict(_item) for _item in obj["document_numbers"]] if obj.get("document_numbers") is not None else None,
158
206
  "document_type": obj.get("document_type"),
159
207
  "first_name": obj.get("first_name"),
208
+ "middle_name": obj.get("middle_name"),
209
+ "last_name": obj.get("last_name"),
160
210
  "gender": obj.get("gender"),
161
211
  "issuing_country": obj.get("issuing_country"),
162
- "last_name": obj.get("last_name"),
163
212
  "nationality": obj.get("nationality"),
164
213
  "issuing_state": obj.get("issuing_state"),
165
214
  "issuing_date": obj.get("issuing_date"),
@@ -173,7 +222,22 @@ class DocumentProperties(BaseModel):
173
222
  "widow_name": obj.get("widow_name"),
174
223
  "alias_name": obj.get("alias_name"),
175
224
  "issuing_authority": obj.get("issuing_authority"),
225
+ "remarks": obj.get("remarks"),
226
+ "civil_state": obj.get("civil_state"),
227
+ "expatriation": obj.get("expatriation"),
228
+ "father_name": obj.get("father_name"),
229
+ "mother_name": obj.get("mother_name"),
230
+ "religion": obj.get("religion"),
231
+ "type_of_permit": obj.get("type_of_permit"),
232
+ "version_number": obj.get("version_number"),
233
+ "document_subtype": obj.get("document_subtype"),
234
+ "profession": obj.get("profession"),
235
+ "security_document_number": obj.get("security_document_number"),
236
+ "tax_number": obj.get("tax_number"),
237
+ "nist_identity_evidence_strength": obj.get("nist_identity_evidence_strength"),
238
+ "has_issuance_confirmation": obj.get("has_issuance_confirmation"),
176
239
  "real_id_compliance": obj.get("real_id_compliance"),
240
+ "security_tier": obj.get("security_tier"),
177
241
  "address_lines": DocumentPropertiesAddressLines.from_dict(obj["address_lines"]) if obj.get("address_lines") is not None else None,
178
242
  "barcode": [DocumentPropertiesBarcodeInner.from_dict(_item) for _item in obj["barcode"]] if obj.get("barcode") is not None else None,
179
243
  "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
@@ -41,8 +41,8 @@ class DocumentShared(BaseModel):
41
41
  if value is None:
42
42
  return value
43
43
 
44
- if value not in set(['jpg', 'png', 'pdf']):
45
- raise ValueError("must be one of enum values ('jpg', 'png', 'pdf')")
44
+ if value not in set(['jpg', 'jpeg', 'png', 'pdf']):
45
+ raise ValueError("must be one of enum values ('jpg', 'jpeg', 'png', 'pdf')")
46
46
  return value
47
47
 
48
48
  @field_validator('side')
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import date
21
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.document_properties_address_lines import DocumentPropertiesAddressLines
24
24
  from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
@@ -38,12 +38,14 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
38
38
  """ # noqa: E501
39
39
  date_of_birth: Optional[date] = None
40
40
  date_of_expiry: Optional[date] = None
41
+ personal_number: Optional[StrictStr] = None
41
42
  document_numbers: Optional[List[DocumentPropertiesDocumentNumbersInner]] = None
42
43
  document_type: Optional[StrictStr] = None
43
44
  first_name: Optional[StrictStr] = None
45
+ middle_name: Optional[StrictStr] = None
46
+ last_name: Optional[StrictStr] = None
44
47
  gender: Optional[StrictStr] = None
45
48
  issuing_country: Optional[StrictStr] = None
46
- last_name: Optional[StrictStr] = None
47
49
  nationality: Optional[StrictStr] = None
48
50
  issuing_state: Optional[StrictStr] = None
49
51
  issuing_date: Optional[date] = None
@@ -57,7 +59,22 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
57
59
  widow_name: Optional[StrictStr] = None
58
60
  alias_name: Optional[StrictStr] = None
59
61
  issuing_authority: Optional[StrictStr] = None
62
+ remarks: Optional[StrictStr] = None
63
+ civil_state: Optional[StrictStr] = None
64
+ expatriation: Optional[StrictStr] = None
65
+ father_name: Optional[StrictStr] = None
66
+ mother_name: Optional[StrictStr] = None
67
+ religion: Optional[StrictStr] = None
68
+ type_of_permit: Optional[StrictStr] = None
69
+ version_number: Optional[StrictStr] = None
70
+ document_subtype: Optional[StrictStr] = None
71
+ profession: Optional[StrictStr] = None
72
+ security_document_number: Optional[StrictStr] = None
73
+ tax_number: Optional[StrictStr] = None
74
+ nist_identity_evidence_strength: Optional[StrictStr] = None
75
+ has_issuance_confirmation: Optional[StrictStr] = None
60
76
  real_id_compliance: Optional[StrictBool] = None
77
+ security_tier: Optional[StrictStr] = None
61
78
  address_lines: Optional[DocumentPropertiesAddressLines] = None
62
79
  barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
63
80
  nfc: Optional[DocumentPropertiesNfc] = None
@@ -71,7 +88,37 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
71
88
  vehicle_class_details: Optional[List[DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner]] = Field(default=None, description="Detailed classes/categories information")
72
89
  passenger_vehicle: Optional[DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle] = None
73
90
  additional_properties: Dict[str, Any] = {}
74
- __properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "document_numbers", "document_type", "first_name", "gender", "issuing_country", "last_name", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "real_id_compliance", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data", "drivers_licence", "restricted_licence", "raw_licence_category", "raw_vehicle_classes", "vehicle_class_details", "passenger_vehicle"]
91
+ __properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "personal_number", "document_numbers", "document_type", "first_name", "middle_name", "last_name", "gender", "issuing_country", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "remarks", "civil_state", "expatriation", "father_name", "mother_name", "religion", "type_of_permit", "version_number", "document_subtype", "profession", "security_document_number", "tax_number", "nist_identity_evidence_strength", "has_issuance_confirmation", "real_id_compliance", "security_tier", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data", "drivers_licence", "restricted_licence", "raw_licence_category", "raw_vehicle_classes", "vehicle_class_details", "passenger_vehicle"]
92
+
93
+ @field_validator('nist_identity_evidence_strength')
94
+ def nist_identity_evidence_strength_validate_enum(cls, value):
95
+ """Validates the enum"""
96
+ if value is None:
97
+ return value
98
+
99
+ if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength']):
100
+ raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength')")
101
+ return value
102
+
103
+ @field_validator('has_issuance_confirmation')
104
+ def has_issuance_confirmation_validate_enum(cls, value):
105
+ """Validates the enum"""
106
+ if value is None:
107
+ return value
108
+
109
+ if value not in set(['true', 'false', 'unspecified']):
110
+ raise ValueError("must be one of enum values ('true', 'false', 'unspecified')")
111
+ return value
112
+
113
+ @field_validator('security_tier')
114
+ def security_tier_validate_enum(cls, value):
115
+ """Validates the enum"""
116
+ if value is None:
117
+ return value
118
+
119
+ if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier']):
120
+ raise ValueError("must be one of enum values ('tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier')")
121
+ return value
75
122
 
76
123
  model_config = ConfigDict(
77
124
  populate_by_name=True,
@@ -172,12 +219,14 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
172
219
  _obj = cls.model_validate({
173
220
  "date_of_birth": obj.get("date_of_birth"),
174
221
  "date_of_expiry": obj.get("date_of_expiry"),
222
+ "personal_number": obj.get("personal_number"),
175
223
  "document_numbers": [DocumentPropertiesDocumentNumbersInner.from_dict(_item) for _item in obj["document_numbers"]] if obj.get("document_numbers") is not None else None,
176
224
  "document_type": obj.get("document_type"),
177
225
  "first_name": obj.get("first_name"),
226
+ "middle_name": obj.get("middle_name"),
227
+ "last_name": obj.get("last_name"),
178
228
  "gender": obj.get("gender"),
179
229
  "issuing_country": obj.get("issuing_country"),
180
- "last_name": obj.get("last_name"),
181
230
  "nationality": obj.get("nationality"),
182
231
  "issuing_state": obj.get("issuing_state"),
183
232
  "issuing_date": obj.get("issuing_date"),
@@ -191,7 +240,22 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
191
240
  "widow_name": obj.get("widow_name"),
192
241
  "alias_name": obj.get("alias_name"),
193
242
  "issuing_authority": obj.get("issuing_authority"),
243
+ "remarks": obj.get("remarks"),
244
+ "civil_state": obj.get("civil_state"),
245
+ "expatriation": obj.get("expatriation"),
246
+ "father_name": obj.get("father_name"),
247
+ "mother_name": obj.get("mother_name"),
248
+ "religion": obj.get("religion"),
249
+ "type_of_permit": obj.get("type_of_permit"),
250
+ "version_number": obj.get("version_number"),
251
+ "document_subtype": obj.get("document_subtype"),
252
+ "profession": obj.get("profession"),
253
+ "security_document_number": obj.get("security_document_number"),
254
+ "tax_number": obj.get("tax_number"),
255
+ "nist_identity_evidence_strength": obj.get("nist_identity_evidence_strength"),
256
+ "has_issuance_confirmation": obj.get("has_issuance_confirmation"),
194
257
  "real_id_compliance": obj.get("real_id_compliance"),
258
+ "security_tier": obj.get("security_tier"),
195
259
  "address_lines": DocumentPropertiesAddressLines.from_dict(obj["address_lines"]) if obj.get("address_lines") is not None else None,
196
260
  "barcode": [DocumentPropertiesBarcodeInner.from_dict(_item) for _item in obj["barcode"]] if obj.get("barcode") is not None else None,
197
261
  "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
@@ -29,10 +29,11 @@ class WebhookEventPayloadObject(BaseModel):
29
29
  """ # noqa: E501
30
30
  id: StrictStr = Field(description="The unique identifier of the resource.")
31
31
  status: Optional[StrictStr] = Field(default=None, description="The current state of the object, if available.")
32
+ started_at_iso8601: Optional[datetime] = Field(default=None, description="The date and time when the operation was started, if available.")
32
33
  completed_at_iso8601: Optional[datetime] = Field(default=None, description="The date and time when the operation was completed, if available.")
33
34
  href: StrictStr = Field(description="The uri of the resource.")
34
35
  additional_properties: Dict[str, Any] = {}
35
- __properties: ClassVar[List[str]] = ["id", "status", "completed_at_iso8601", "href"]
36
+ __properties: ClassVar[List[str]] = ["id", "status", "started_at_iso8601", "completed_at_iso8601", "href"]
36
37
 
37
38
  model_config = ConfigDict(
38
39
  populate_by_name=True,
@@ -94,6 +95,7 @@ class WebhookEventPayloadObject(BaseModel):
94
95
  _obj = cls.model_validate({
95
96
  "id": obj.get("id"),
96
97
  "status": obj.get("status"),
98
+ "started_at_iso8601": obj.get("started_at_iso8601"),
97
99
  "completed_at_iso8601": obj.get("completed_at_iso8601"),
98
100
  "href": obj.get("href")
99
101
  })
@@ -1,21 +1,24 @@
1
1
  import hmac
2
2
  import hashlib
3
- import json
4
3
 
5
4
  from .models import WebhookEvent
6
5
 
6
+
7
7
  class OnfidoInvalidSignatureError(Exception):
8
8
  pass
9
9
 
10
+
10
11
  class WebhookEventVerifier:
11
12
  def __init__(self, webhook_token):
12
13
  self.webhook_token = webhook_token
13
14
 
14
15
  def read_payload(self, raw_event, signature):
15
16
  # Compute the the actual HMAC signature from the raw request body.
16
- event_signature = hmac.new(key=self.webhook_token.encode("utf-8"),
17
- msg=raw_event.encode("utf-8"),
18
- digestmod=hashlib.sha256).hexdigest()
17
+ event_signature = hmac.new(
18
+ key=self.webhook_token.encode("utf-8"),
19
+ msg=raw_event.encode("utf-8"),
20
+ digestmod=hashlib.sha256,
21
+ ).hexdigest()
19
22
 
20
23
  # Compare the signatures (prevent against timing attacks).
21
24
  if not hmac.compare_digest(signature, event_signature):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: onfido-python
3
- Version: 3.1.0
3
+ Version: 3.3.0
4
4
  Summary: Python library for the Onfido API
5
5
  Home-page:
6
6
  Author: OpenAPI Generator community
@@ -1,13 +1,13 @@
1
- onfido/__init__.py,sha256=VrBQDCcdxyUQsfrw0d2SJihjONvolMo8xk60aodGfL4,27053
2
- onfido/api_client.py,sha256=vg4wTa9ZeuzaM1CgZyhMT9-GV_pRm828uAf3lfqh0wA,26205
1
+ onfido/__init__.py,sha256=oZ8T3TqtvOz-mDpbgg2FIAptR9vAbVUsYcGLmaJkv8Y,27053
2
+ onfido/api_client.py,sha256=CGsFK2H5x8VO4yXLH8nA7YyxSob2FosUT3vauvu3u5w,26205
3
3
  onfido/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
- onfido/configuration.py,sha256=moVSShURgTuKaLvP7ibfuqI0AiqxtuO21m6T-GStR1A,14613
4
+ onfido/configuration.py,sha256=DiBi_YlOW9Hzhglao7GZB3LJGGqM4DOiDmfo5GnipNA,14613
5
5
  onfido/exceptions.py,sha256=5W4DJIPVwIzljxoedh5czPXOTBaq6CTTVD92h5ZyN88,5894
6
6
  onfido/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  onfido/rest.py,sha256=NSJRLqL8U0UzO2YY0KCP4_BmvhOedRHC7zGVTrJ1VFU,9415
8
- onfido/webhook_event_verifier.py,sha256=Xy1eK8zorxqCKvLmJw9hS_-B6j_N-akJjxjZp0M8u20,847
8
+ onfido/webhook_event_verifier.py,sha256=3BSbY5D8NTXDbxCX0POuyu5a09dEeWgmikrTe_pttkI,814
9
9
  onfido/api/__init__.py,sha256=hqeJm_GD67zukfFQ-H5PPPxYgZZ0DKOMPGTNRAjc3gw,94
10
- onfido/api/default_api.py,sha256=LlouO2AJZplA7pOfPqDsmUSaPS8dFoQZG-0CDd1l77Y,675834
10
+ onfido/api/default_api.py,sha256=Eelike5MvHvPpw8u8KchC9Bfn4sPkjMk7TH0LyeHTMs,687639
11
11
  onfido/models/__init__.py,sha256=XJ5d4YV52FNXwBYQabTrtVBd-Y61_po8BdxlCJd-prg,26401
12
12
  onfido/models/address.py,sha256=47oVzKVhn6Qxd24HMIuAQmVKgHPyfOnlFmBnthi2wOE,6812
13
13
  onfido/models/address_builder.py,sha256=SjuOn2_T7Yic2l7qhaxd-euaijx85BziRkunp5j292M,6840
@@ -42,7 +42,7 @@ onfido/models/device_intelligence_breakdown_properties_device.py,sha256=DUWTZDuh
42
42
  onfido/models/device_intelligence_breakdown_properties_geolocation.py,sha256=78wKBOHlNHAc96ZWMPa6hQQPbYKX6ospdNYgyL56-qM,3618
43
43
  onfido/models/device_intelligence_breakdown_properties_ip.py,sha256=NaFRkErYehw5bOf-hbz2xuWYJ0gz0ErDhBR0SpcZpBQ,3783
44
44
  onfido/models/device_intelligence_report.py,sha256=5loxXEhqlhMrZc9r4lJ8XzaLpz-NoOD11P2gPzckqPs,5468
45
- onfido/models/document.py,sha256=ZFRqyDtso3DtKSbRecnlc6VAhCxGGGlp-8YGDSs1TdQ,5525
45
+ onfido/models/document.py,sha256=IF9bzlAXgTK1ZoSNILrZ4mHPXVhlQGl0DGS1JxLn_Hk,5541
46
46
  onfido/models/document_breakdown.py,sha256=x7lFBT2V2jJvW0JZ6-U_Ca9vjjPOvtCVJP0i__tYc_Y,7813
47
47
  onfido/models/document_breakdown_age_validation.py,sha256=ioeCHhNEJB4DnY7cqv-oBa87g46mpnq6BBzBIiafXB8,3699
48
48
  onfido/models/document_breakdown_age_validation_breakdown.py,sha256=6idaiBhh_9xFguIEwVbgJqO5qldeNwiAhWJg0U2h3io,3692
@@ -81,7 +81,7 @@ onfido/models/document_breakdown_visual_authenticity_breakdown_template.py,sha25
81
81
  onfido/models/document_cdq_reasons.py,sha256=1m2qxLuIeC1HKVQim9TLt95l76FDi_rJi0uBYKtd03E,5214
82
82
  onfido/models/document_iq_reasons.py,sha256=OKiCuxShiJ4uBrALjsK_Z_z28fnLwPEYev5YV6cDOVc,5392
83
83
  onfido/models/document_odp_reasons.py,sha256=RQ6UAGnhkg7hfwOaEqAbuxdjIh2F1QyAhsoIpRsQfN0,3966
84
- onfido/models/document_properties.py,sha256=owd2EBTyVzz3Q1tO4GkvBYrBgs6z2aIDvnK6uLC_6kk,9420
84
+ onfido/models/document_properties.py,sha256=d6D_RgJLVS_LMuR1ff9RwtDzv59FkBrMRxnHvySrtIE,12860
85
85
  onfido/models/document_properties_address_lines.py,sha256=KBEQPfyCQNpoA_VjP6vKroWqnOa_sy-G_UnyiBox-jI,3606
86
86
  onfido/models/document_properties_barcode_inner.py,sha256=FVPy1Gc65ECQDY3cuF8J5jhuUNBceyua0ldUepaGZmA,5150
87
87
  onfido/models/document_properties_document_classification.py,sha256=YRa0qNQBNXCPnHJn9_N0lKaXzhVCC-xKPezBBaYR7mU,3400
@@ -91,13 +91,13 @@ onfido/models/document_properties_extracted_data.py,sha256=vW-B2osOZhlGdeanDlgBD
91
91
  onfido/models/document_properties_nfc.py,sha256=0ToFxpEA45NN6Oy9jpOzmLktJpWLAWhBREjehJds-1Y,4475
92
92
  onfido/models/document_report.py,sha256=0D7BPKmtW1yi_STY_pnS0yHS1prACWFZUqFyn1iBaEw,5817
93
93
  onfido/models/document_response.py,sha256=feTxv5jfkyXhoJaaE4fNlWPWrXqdjRGOYnqqUoMzuMg,3956
94
- onfido/models/document_shared.py,sha256=EF8s5VmoocjhuGII5Nb9qhpwYar7cS7h0ilbIIcRdSs,4542
94
+ onfido/models/document_shared.py,sha256=R4jJg6D-GXSrTpXavHpdHfvNWIYaY1s4XfiwFUr682g,4558
95
95
  onfido/models/document_types.py,sha256=i-LPmO8G7e-YfuzvvvJZ40SZYebjk227CndXtZOXCrk,1824
96
96
  onfido/models/document_video_report.py,sha256=os-qrNYCUECejSC35jPLUsXDxe7y6f5g0s3_QD8__Eo,5837
97
97
  onfido/models/document_video_with_address_information_report.py,sha256=m_-BBX6i36ETlHJO9NwZIY7eVmJMdgoiYPjjg0NT9Sw,5925
98
98
  onfido/models/document_with_address_information_report.py,sha256=BkksAiZC-ooMik5JJxVMFrKtIZ5ZzMFIO2roRx7lhxU,5905
99
99
  onfido/models/document_with_driver_verification_report.py,sha256=LkwKvOa7WaQRXw2A3incYjK8_b4tC_upnoxpaQ8Eek0,6043
100
- onfido/models/document_with_driver_verification_report_all_of_properties.py,sha256=27ZUfACsDEEqgFnGZllE7LqhWJkpQocQ_An00QO1qNk,12244
100
+ onfido/models/document_with_driver_verification_report_all_of_properties.py,sha256=4Eyh2f8O4fVtwf2aOGwZuV9DPlVpRmimJgAjqB0fURQ,15684
101
101
  onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.py,sha256=xI7noUuOz8MIrJ7iErenQgww2EmgTukpYehLBcC1zZI,3792
102
102
  onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.py,sha256=7IYp8uXyMjA2WKyEDkQw_3_ZixPVosy3x7XcXSksXVQ,3866
103
103
  onfido/models/document_with_driving_licence_information_report.py,sha256=vGMnVXPNdsgCcvWLGPNvO2FnGUZFYK89SVAbAQlXkUY,5933
@@ -268,7 +268,7 @@ onfido/models/webhook_builder.py,sha256=pwhg4W9CuRSdup25LJAV099md70EHPJ9H9gEaREG
268
268
  onfido/models/webhook_create.py,sha256=8Ur6l4YhUAaIl4WCd-dWqPVmHGZ-2cxROA--U0BLVus,3070
269
269
  onfido/models/webhook_event.py,sha256=g5lobXwKJsA0J34puBVMcLbm7vcrVlZoFTuvRvCFE9o,3323
270
270
  onfido/models/webhook_event_payload.py,sha256=06DUF1HdWTbWhB6_tSHoGXiZuEwoil3WJxoDiNoPZUk,3954
271
- onfido/models/webhook_event_payload_object.py,sha256=99d1pPcVCyjZAttqiimNekwdj2JU4Seu31zTGoqeXcI,3664
271
+ onfido/models/webhook_event_payload_object.py,sha256=Cvccr6bVuT43yECl2xTJPjjiYUfvgDVlqRTHSYjzSDE,3895
272
272
  onfido/models/webhook_event_type.py,sha256=AP1JjrpjTyoATidiS0O_WnKyIEN4wrW-V0udJu-aLqs,1569
273
273
  onfido/models/webhook_resend.py,sha256=pDG9j6l-hrUq9UU_XI_g5zZTsvE69zgeSynYQ936R6Y,3463
274
274
  onfido/models/webhook_response.py,sha256=VpnpGMafbWR7oj2Tws-sQlVmNzP9RPEMKvQ_g6wrbt0,3557
@@ -284,8 +284,8 @@ onfido/models/workflow_run_response.py,sha256=YKYOf78z7GA2IG0B_EDJMqEtdqssVdzzhC
284
284
  onfido/models/workflow_run_response_error.py,sha256=93xJUVTdo4PUsMzOdcsAifRWlZiTh6nO-nDPUc2SMTs,3311
285
285
  onfido/models/workflow_run_shared.py,sha256=fHcZBs61MokjwyaAD1tDKoefpoTwM-DCeiBkjV5n6E8,4561
286
286
  onfido/models/workflow_run_shared_link.py,sha256=8uAlWkhDF9g_7CuVfhoAXgZqcv6LZHOIc4c_CqMxths,4682
287
- onfido_python-3.1.0.dist-info/LICENSE,sha256=SKY_O1OkFX8yNWFuVVfYTsXvN46jsgtff-xReserHw4,1073
288
- onfido_python-3.1.0.dist-info/METADATA,sha256=YCqVUTzumAzHazUwigv74xlbaKG87pcZH6bsDvz3E1c,482
289
- onfido_python-3.1.0.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
290
- onfido_python-3.1.0.dist-info/top_level.txt,sha256=NHu8xI4S4Avh7xUark3dpdk9atpIVgyf-ptjHXU0-Ns,7
291
- onfido_python-3.1.0.dist-info/RECORD,,
287
+ onfido_python-3.3.0.dist-info/LICENSE,sha256=SKY_O1OkFX8yNWFuVVfYTsXvN46jsgtff-xReserHw4,1073
288
+ onfido_python-3.3.0.dist-info/METADATA,sha256=40NH6GKoTftSKonaG_9fSJYypX6SsLHjEKpm3FP2Nxg,482
289
+ onfido_python-3.3.0.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
290
+ onfido_python-3.3.0.dist-info/top_level.txt,sha256=NHu8xI4S4Avh7xUark3dpdk9atpIVgyf-ptjHXU0-Ns,7
291
+ onfido_python-3.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5