onfido 4.2.0 → 4.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/lib/onfido/api_client.rb +1 -1
- data/lib/onfido/models/document_properties.rb +4 -2
- data/lib/onfido/models/{document_properties_barcode.rb → document_properties_barcode_inner.rb} +3 -3
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties.rb +4 -2
- data/lib/onfido/models/task.rb +1 -1
- data/lib/onfido/models/webhook_event_payload_resource.rb +1 -1
- data/lib/onfido/models/webhook_event_resource_type.rb +3 -1
- data/lib/onfido/models/webhook_event_type.rb +2 -1
- data/lib/onfido/version.rb +1 -1
- data/lib/onfido.rb +1 -1
- data/spec/integrations/report_schema_spec.rb +2 -2
- data/spec/media/studio_webhook_event_with_list_in_output.json +31 -0
- data/spec/media/studio_webhook_event_with_object_in_output.json +264 -0
- data/spec/studio_webhook_event_verifier_spec.rb +39 -0
- metadata +23 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad8d065a1432b0a9784b7e7abbc4232330b7473fc93295cee357f67472dc19d
|
4
|
+
data.tar.gz: '044988fa7351554b18584f22603922cf2b1f2f0fc35b48c7b398fa8f2e5bb26e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 035d43c3d89ef350ba28be90e9c395edcddc88cf06a063ee49eef0c2eb0d3e5e0c7e6d3da9eccfcc9db76cb580c9b1cd164f8e5e2418021797ebe22f217aabcb
|
7
|
+
data.tar.gz: 53cbebd670af14ba05ba595ce0af26fd7b973c6042dd072cd9a291163ba4d0e31ac3a9c32de82b902c8b950c4ea07cb5de0c3d734b628f7a48cc71b1702bea7b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v4.3.0 27th November 2024
|
4
|
+
|
5
|
+
- Release based on Onfido OpenAPI spec version [v4.3.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.3.0):
|
6
|
+
- [CAT-1581] Revert "[CAT-1528] Fix barcode field in document properties object"
|
7
|
+
|
8
|
+
## v4.2.0 19th November 2024
|
9
|
+
|
10
|
+
- Release based on Onfido OpenAPI spec version [v4.2.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.2.0):
|
11
|
+
- feat: add new fields to facial similarity report objects
|
12
|
+
- [CAT-1552] Add missing document types
|
13
|
+
|
3
14
|
## v4.1.0 8th November 2024
|
4
15
|
|
5
16
|
- Release based on Onfido OpenAPI spec version [v4.1.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.1.0):
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
|
|
14
14
|
### Installation
|
15
15
|
|
16
16
|
```ruby
|
17
|
-
gem onfido, '~> 4.
|
17
|
+
gem onfido, '~> 4.4.0'
|
18
18
|
```
|
19
19
|
|
20
20
|
Configure with your API token, region and optional timeout (default value is 30):
|
data/lib/onfido/api_client.rb
CHANGED
@@ -34,7 +34,7 @@ module Onfido
|
|
34
34
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
35
35
|
def initialize(config = Configuration.default)
|
36
36
|
@config = config
|
37
|
-
@user_agent = "onfido-ruby/4.
|
37
|
+
@user_agent = "onfido-ruby/4.4.0"
|
38
38
|
@default_headers = {
|
39
39
|
'Content-Type' => 'application/json',
|
40
40
|
'User-Agent' => @user_agent
|
@@ -226,7 +226,7 @@ module Onfido
|
|
226
226
|
:'real_id_compliance' => :'Boolean',
|
227
227
|
:'security_tier' => :'String',
|
228
228
|
:'address_lines' => :'DocumentPropertiesAddressLines',
|
229
|
-
:'barcode' => :'
|
229
|
+
:'barcode' => :'Array<DocumentPropertiesBarcodeInner>',
|
230
230
|
:'nfc' => :'DocumentPropertiesNfc',
|
231
231
|
:'driving_licence_information' => :'DocumentPropertiesDrivingLicenceInformation',
|
232
232
|
:'document_classification' => :'DocumentPropertiesDocumentClassification',
|
@@ -418,7 +418,9 @@ module Onfido
|
|
418
418
|
end
|
419
419
|
|
420
420
|
if attributes.key?(:'barcode')
|
421
|
-
|
421
|
+
if (value = attributes[:'barcode']).is_a?(Array)
|
422
|
+
self.barcode = value
|
423
|
+
end
|
422
424
|
end
|
423
425
|
|
424
426
|
if attributes.key?(:'nfc')
|
data/lib/onfido/models/{document_properties_barcode.rb → document_properties_barcode_inner.rb}
RENAMED
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Onfido
|
17
|
-
class
|
17
|
+
class DocumentPropertiesBarcodeInner
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
20
20
|
attr_accessor :middle_name
|
@@ -114,13 +114,13 @@ module Onfido
|
|
114
114
|
# @param [Hash] attributes Model attributes in the form of hash
|
115
115
|
def initialize(attributes = {})
|
116
116
|
if (!attributes.is_a?(Hash))
|
117
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::
|
117
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::DocumentPropertiesBarcodeInner` initialize method"
|
118
118
|
end
|
119
119
|
|
120
120
|
# check to see if the attribute exists and convert string to symbol for hash key
|
121
121
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
122
122
|
if (!self.class.attribute_map.key?(k.to_sym))
|
123
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::
|
123
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::DocumentPropertiesBarcodeInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
124
124
|
end
|
125
125
|
h[k.to_sym] = v
|
126
126
|
}
|
@@ -249,7 +249,7 @@ module Onfido
|
|
249
249
|
:'real_id_compliance' => :'Boolean',
|
250
250
|
:'security_tier' => :'String',
|
251
251
|
:'address_lines' => :'DocumentPropertiesAddressLines',
|
252
|
-
:'barcode' => :'
|
252
|
+
:'barcode' => :'Array<DocumentPropertiesBarcodeInner>',
|
253
253
|
:'nfc' => :'DocumentPropertiesNfc',
|
254
254
|
:'driving_licence_information' => :'DocumentPropertiesDrivingLicenceInformation',
|
255
255
|
:'document_classification' => :'DocumentPropertiesDocumentClassification',
|
@@ -454,7 +454,9 @@ module Onfido
|
|
454
454
|
end
|
455
455
|
|
456
456
|
if attributes.key?(:'barcode')
|
457
|
-
|
457
|
+
if (value = attributes[:'barcode']).is_a?(Array)
|
458
|
+
self.barcode = value
|
459
|
+
end
|
458
460
|
end
|
459
461
|
|
460
462
|
if attributes.key?(:'nfc')
|
data/lib/onfido/models/task.rb
CHANGED
@@ -30,7 +30,7 @@ module Onfido
|
|
30
30
|
# Input object with the fields used by the Task to execute.
|
31
31
|
attr_accessor :input
|
32
32
|
|
33
|
-
#
|
33
|
+
# Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.
|
34
34
|
attr_accessor :output
|
35
35
|
|
36
36
|
# The date and time when the Task was created.
|
@@ -48,7 +48,7 @@ module Onfido
|
|
48
48
|
# Input object with the fields used by the Task execution.
|
49
49
|
attr_accessor :input
|
50
50
|
|
51
|
-
#
|
51
|
+
# Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.
|
52
52
|
attr_accessor :output
|
53
53
|
|
54
54
|
# The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version.
|
@@ -21,10 +21,12 @@ module Onfido
|
|
21
21
|
WORKFLOW_RUN = "workflow_run".freeze
|
22
22
|
WORKFLOW_TASK = "workflow_task".freeze
|
23
23
|
WATCHLIST_MONITOR = "watchlist_monitor".freeze
|
24
|
+
WORKFLOW_TIMELINE_FILE = "workflow_timeline_file".freeze
|
25
|
+
WORKFLOW_RUN_EVIDENCE_FOLDER = "workflow_run_evidence_folder".freeze
|
24
26
|
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
|
25
27
|
|
26
28
|
def self.all_vars
|
27
|
-
@all_vars ||= [CHECK, REPORT, AUDIT_LOG, WORKFLOW_RUN, WORKFLOW_TASK, WATCHLIST_MONITOR, UNKNOWN_DEFAULT_OPEN_API].freeze
|
29
|
+
@all_vars ||= [CHECK, REPORT, AUDIT_LOG, WORKFLOW_RUN, WORKFLOW_TASK, WATCHLIST_MONITOR, WORKFLOW_TIMELINE_FILE, WORKFLOW_RUN_EVIDENCE_FOLDER, UNKNOWN_DEFAULT_OPEN_API].freeze
|
28
30
|
end
|
29
31
|
|
30
32
|
# Builds the enum from string
|
@@ -32,10 +32,11 @@ module Onfido
|
|
32
32
|
REPORT_COMPLETED = "report.completed".freeze
|
33
33
|
WORKFLOW_TIMELINE_FILE_CREATED = "workflow_timeline_file.created".freeze
|
34
34
|
WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED = "workflow_signed_evidence_file.created".freeze
|
35
|
+
WORKFLOW_RUN_EVIDENCE_FOLDER_CREATED = "workflow_run_evidence_folder.created".freeze
|
35
36
|
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
|
36
37
|
|
37
38
|
def self.all_vars
|
38
|
-
@all_vars ||= [AUDIT_LOG_CREATED, WATCHLIST_MONITOR_MATCHES_UPDATED, WORKFLOW_RUN_COMPLETED, WORKFLOW_TASK_STARTED, WORKFLOW_TASK_COMPLETED, CHECK_STARTED, CHECK_REOPENED, CHECK_WITHDRAWN, CHECK_COMPLETED, CHECK_FORM_COMPLETED, REPORT_WITHDRAWN, REPORT_RESUMED, REPORT_CANCELLED, REPORT_AWAITING_APPROVAL, REPORT_COMPLETED, WORKFLOW_TIMELINE_FILE_CREATED, WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED, UNKNOWN_DEFAULT_OPEN_API].freeze
|
39
|
+
@all_vars ||= [AUDIT_LOG_CREATED, WATCHLIST_MONITOR_MATCHES_UPDATED, WORKFLOW_RUN_COMPLETED, WORKFLOW_TASK_STARTED, WORKFLOW_TASK_COMPLETED, CHECK_STARTED, CHECK_REOPENED, CHECK_WITHDRAWN, CHECK_COMPLETED, CHECK_FORM_COMPLETED, REPORT_WITHDRAWN, REPORT_RESUMED, REPORT_CANCELLED, REPORT_AWAITING_APPROVAL, REPORT_COMPLETED, WORKFLOW_TIMELINE_FILE_CREATED, WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED, WORKFLOW_RUN_EVIDENCE_FOLDER_CREATED, UNKNOWN_DEFAULT_OPEN_API].freeze
|
39
40
|
end
|
40
41
|
|
41
42
|
# Builds the enum from string
|
data/lib/onfido/version.rb
CHANGED
data/lib/onfido.rb
CHANGED
@@ -92,7 +92,7 @@ require 'onfido/models/document_iq_reasons'
|
|
92
92
|
require 'onfido/models/document_odp_reasons'
|
93
93
|
require 'onfido/models/document_properties'
|
94
94
|
require 'onfido/models/document_properties_address_lines'
|
95
|
-
require 'onfido/models/
|
95
|
+
require 'onfido/models/document_properties_barcode_inner'
|
96
96
|
require 'onfido/models/document_properties_document_classification'
|
97
97
|
require 'onfido/models/document_properties_document_numbers_inner'
|
98
98
|
require 'onfido/models/document_properties_driving_licence_information'
|
@@ -55,8 +55,8 @@ describe Onfido::Report do
|
|
55
55
|
) { onfido_api.find_report(report_id) }
|
56
56
|
|
57
57
|
expect(report).to be_an_instance_of Onfido::DocumentWithAddressInformationReport
|
58
|
-
expect(report.properties.barcode).to be_an_instance_of Onfido::
|
59
|
-
expect(report.properties.barcode.document_type).to eq("driving_licence")
|
58
|
+
expect(report.properties.barcode[0]).to be_an_instance_of Onfido::DocumentPropertiesBarcodeInner
|
59
|
+
expect(report.properties.barcode[0].document_type).to eq("driving_licence")
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"payload": {
|
3
|
+
"resource_type": "workflow_task",
|
4
|
+
"action": "workflow_task.completed",
|
5
|
+
"object": {
|
6
|
+
"id": "document_photo_5c229",
|
7
|
+
"task_spec_id": "document_photo_5c229",
|
8
|
+
"task_def_id": "upload_document_photo",
|
9
|
+
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
|
10
|
+
"status": "completed",
|
11
|
+
"completed_at_iso8601": "2024-12-18T18:13:10Z",
|
12
|
+
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_photo_5c229"
|
13
|
+
},
|
14
|
+
"resource": {
|
15
|
+
"updated_at": "2024-12-18T18:13:10Z",
|
16
|
+
"output": [
|
17
|
+
{
|
18
|
+
"type": "document_photo",
|
19
|
+
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
|
20
|
+
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU="
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"created_at": "2024-12-18T18:12:44Z",
|
24
|
+
"task_def_id": "upload_document_photo",
|
25
|
+
"input": {},
|
26
|
+
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
|
27
|
+
"task_def_version": null,
|
28
|
+
"id": "document_photo_5c229"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,264 @@
|
|
1
|
+
{
|
2
|
+
"payload": {
|
3
|
+
"resource_type": "workflow_task",
|
4
|
+
"action": "workflow_task.completed",
|
5
|
+
"object": {
|
6
|
+
"id": "document_check_75329",
|
7
|
+
"task_spec_id": "document_check_75329",
|
8
|
+
"task_def_id": "document_check",
|
9
|
+
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
|
10
|
+
"status": "completed",
|
11
|
+
"completed_at_iso8601": "2024-12-18T18:13:13Z",
|
12
|
+
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_check_75329"
|
13
|
+
},
|
14
|
+
"resource": {
|
15
|
+
"task_def_version": null,
|
16
|
+
"task_def_id": "document_check",
|
17
|
+
"updated_at": "2024-12-18T18:13:13Z",
|
18
|
+
"id": "document_check_75329",
|
19
|
+
"output": {
|
20
|
+
"status": "complete",
|
21
|
+
"result": "clear",
|
22
|
+
"sub_result": "clear",
|
23
|
+
"uuid": "95c8cc09-db72-42ff-85ef-ee6c82020a24",
|
24
|
+
"properties": {
|
25
|
+
"date_of_birth": "1990-01-01",
|
26
|
+
"date_of_expiry": "2031-05-28",
|
27
|
+
"document_numbers": [
|
28
|
+
{
|
29
|
+
"type": "document_number",
|
30
|
+
"value": "999999999"
|
31
|
+
}
|
32
|
+
],
|
33
|
+
"document_type": "passport",
|
34
|
+
"first_name": "Jane",
|
35
|
+
"issuing_country": "GBR",
|
36
|
+
"last_name": "Doe",
|
37
|
+
"document_number": "999999999"
|
38
|
+
},
|
39
|
+
"breakdown": {
|
40
|
+
"data_validation": {
|
41
|
+
"result": "clear",
|
42
|
+
"breakdown": {
|
43
|
+
"mrz": {
|
44
|
+
"result": "clear",
|
45
|
+
"properties": {}
|
46
|
+
},
|
47
|
+
"expiry_date": {
|
48
|
+
"result": "clear",
|
49
|
+
"properties": {}
|
50
|
+
},
|
51
|
+
"document_expiration": {
|
52
|
+
"result": "clear",
|
53
|
+
"properties": {}
|
54
|
+
},
|
55
|
+
"document_numbers": {
|
56
|
+
"result": "clear",
|
57
|
+
"properties": {}
|
58
|
+
},
|
59
|
+
"date_of_birth": {
|
60
|
+
"result": "clear",
|
61
|
+
"properties": {}
|
62
|
+
},
|
63
|
+
"gender": {
|
64
|
+
"result": "clear",
|
65
|
+
"properties": {}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"visual_authenticity": {
|
70
|
+
"result": "clear",
|
71
|
+
"breakdown": {
|
72
|
+
"face_detection": {
|
73
|
+
"result": "clear",
|
74
|
+
"properties": {}
|
75
|
+
},
|
76
|
+
"other": {
|
77
|
+
"result": "clear",
|
78
|
+
"properties": {}
|
79
|
+
},
|
80
|
+
"digital_tampering": {
|
81
|
+
"result": "clear",
|
82
|
+
"properties": {}
|
83
|
+
},
|
84
|
+
"original_document_present": {
|
85
|
+
"result": "clear",
|
86
|
+
"properties": {}
|
87
|
+
},
|
88
|
+
"security_features": {
|
89
|
+
"result": "clear",
|
90
|
+
"properties": {}
|
91
|
+
},
|
92
|
+
"template": {
|
93
|
+
"result": "clear",
|
94
|
+
"properties": {}
|
95
|
+
},
|
96
|
+
"picture_face_integrity": {
|
97
|
+
"result": "clear",
|
98
|
+
"properties": {}
|
99
|
+
},
|
100
|
+
"fonts": {
|
101
|
+
"result": "clear",
|
102
|
+
"properties": {}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
},
|
106
|
+
"compromised_document": {
|
107
|
+
"result": "clear",
|
108
|
+
"breakdown": {
|
109
|
+
"repeat_attempts": {
|
110
|
+
"result": "clear",
|
111
|
+
"properties": {}
|
112
|
+
},
|
113
|
+
"document_database": {
|
114
|
+
"result": "clear",
|
115
|
+
"properties": {}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
},
|
119
|
+
"data_consistency": {
|
120
|
+
"result": "clear",
|
121
|
+
"breakdown": {
|
122
|
+
"nationality": {
|
123
|
+
"result": "clear",
|
124
|
+
"properties": {}
|
125
|
+
},
|
126
|
+
"last_name": {
|
127
|
+
"result": "clear",
|
128
|
+
"properties": {}
|
129
|
+
},
|
130
|
+
"first_name": {
|
131
|
+
"result": "clear",
|
132
|
+
"properties": {}
|
133
|
+
},
|
134
|
+
"multiple_data_sources_present": {
|
135
|
+
"result": "clear",
|
136
|
+
"properties": {}
|
137
|
+
},
|
138
|
+
"gender": {
|
139
|
+
"result": "clear",
|
140
|
+
"properties": {}
|
141
|
+
},
|
142
|
+
"date_of_birth": {
|
143
|
+
"result": "clear",
|
144
|
+
"properties": {}
|
145
|
+
},
|
146
|
+
"document_type": {
|
147
|
+
"result": "clear",
|
148
|
+
"properties": {}
|
149
|
+
},
|
150
|
+
"issuing_country": {
|
151
|
+
"result": "clear",
|
152
|
+
"properties": {}
|
153
|
+
},
|
154
|
+
"document_numbers": {
|
155
|
+
"result": "clear",
|
156
|
+
"properties": {}
|
157
|
+
},
|
158
|
+
"date_of_expiry": {
|
159
|
+
"result": "clear",
|
160
|
+
"properties": {}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
},
|
164
|
+
"data_comparison": {
|
165
|
+
"result": "clear",
|
166
|
+
"breakdown": {
|
167
|
+
"date_of_birth": {
|
168
|
+
"result": "clear",
|
169
|
+
"properties": {}
|
170
|
+
},
|
171
|
+
"first_name": {
|
172
|
+
"result": "clear",
|
173
|
+
"properties": {}
|
174
|
+
},
|
175
|
+
"document_numbers": {
|
176
|
+
"result": "clear",
|
177
|
+
"properties": {}
|
178
|
+
},
|
179
|
+
"document_type": {
|
180
|
+
"result": "clear",
|
181
|
+
"properties": {}
|
182
|
+
},
|
183
|
+
"last_name": {
|
184
|
+
"result": "clear",
|
185
|
+
"properties": {}
|
186
|
+
},
|
187
|
+
"date_of_expiry": {
|
188
|
+
"result": "clear",
|
189
|
+
"properties": {}
|
190
|
+
},
|
191
|
+
"gender": {
|
192
|
+
"result": "clear",
|
193
|
+
"properties": {}
|
194
|
+
},
|
195
|
+
"issuing_country": {
|
196
|
+
"result": "clear",
|
197
|
+
"properties": {}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
},
|
201
|
+
"image_integrity": {
|
202
|
+
"result": "clear",
|
203
|
+
"breakdown": {
|
204
|
+
"colour_picture": {
|
205
|
+
"result": "clear",
|
206
|
+
"properties": {}
|
207
|
+
},
|
208
|
+
"supported_document": {
|
209
|
+
"result": "clear",
|
210
|
+
"properties": {}
|
211
|
+
},
|
212
|
+
"conclusive_document_quality": {
|
213
|
+
"result": "clear",
|
214
|
+
"properties": {}
|
215
|
+
},
|
216
|
+
"image_quality": {
|
217
|
+
"result": "clear",
|
218
|
+
"properties": {}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
"police_record": {
|
223
|
+
"result": "clear",
|
224
|
+
"breakdown": {
|
225
|
+
"document_has_not_been_recorded_as_lost,_stolen_or_compromised": {
|
226
|
+
"result": "clear",
|
227
|
+
"properties": {}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
},
|
231
|
+
"age_validation": {
|
232
|
+
"result": "clear",
|
233
|
+
"breakdown": {
|
234
|
+
"minimum_accepted_age": {
|
235
|
+
"result": "clear",
|
236
|
+
"properties": {}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
},
|
241
|
+
"repeat_attempts": {
|
242
|
+
"report_id": "00000000-0000-0000-0000-000000000000",
|
243
|
+
"repeat_attempts": [],
|
244
|
+
"attempts_count": 1,
|
245
|
+
"attempts_clear_rate": 0,
|
246
|
+
"unique_mismatches_count": 0
|
247
|
+
}
|
248
|
+
},
|
249
|
+
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
|
250
|
+
"input": {
|
251
|
+
"document_ids": [
|
252
|
+
{
|
253
|
+
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU=",
|
254
|
+
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
|
255
|
+
"type": "document_photo"
|
256
|
+
}
|
257
|
+
],
|
258
|
+
"first_name": "Jane",
|
259
|
+
"last_name": "Doe"
|
260
|
+
},
|
261
|
+
"created_at": "2024-12-18T18:13:11Z"
|
262
|
+
}
|
263
|
+
}
|
264
|
+
}
|
@@ -35,5 +35,44 @@ describe Onfido::WebhookEventVerifier do
|
|
35
35
|
expect(webhook_event.payload.resource.task_def_id).to eq('profile_data')
|
36
36
|
expect(webhook_event.payload.resource.output).to eq(nil)
|
37
37
|
end
|
38
|
+
|
39
|
+
context "when webhook event output is an object" do
|
40
|
+
it "is able to decode and read the output field" do
|
41
|
+
signature = "e3e5565647f5ccf07b2fd8ac22eab94a0a0619413d981fb768295c820523f7d7"
|
42
|
+
|
43
|
+
event = subject.read_payload(File.read('spec/media/studio_webhook_event_with_object_in_output.json'), signature)
|
44
|
+
|
45
|
+
expect(event.payload.resource.output['properties']).to eq({
|
46
|
+
"date_of_birth" => "1990-01-01",
|
47
|
+
"date_of_expiry" => "2031-05-28",
|
48
|
+
"document_number" => "999999999",
|
49
|
+
"document_numbers" => [
|
50
|
+
{
|
51
|
+
"type"=>"document_number",
|
52
|
+
"value"=>"999999999"
|
53
|
+
}
|
54
|
+
],
|
55
|
+
"document_type" => "passport",
|
56
|
+
"first_name" => "Jane",
|
57
|
+
"issuing_country" => "GBR",
|
58
|
+
"last_name" => "Doe",
|
59
|
+
})
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "when webhook event output is an array" do
|
64
|
+
it "is able to decode and read the output field" do
|
65
|
+
signature = "f3a5170acfcecf8c1bf6d9cb9995c0d9dec941af83056a721530f8de7af2c293"
|
66
|
+
event = subject.read_payload(File.read('spec/media/studio_webhook_event_with_list_in_output.json'), signature)
|
67
|
+
|
68
|
+
expect(event.payload.resource.output).to eq([
|
69
|
+
{
|
70
|
+
"checksum_sha256"=>"hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU=",
|
71
|
+
"id"=>"7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
|
72
|
+
"type"=>"document_photo"
|
73
|
+
}
|
74
|
+
])
|
75
|
+
end
|
76
|
+
end
|
38
77
|
end
|
39
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onfido
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI-Generator
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -213,7 +213,7 @@ files:
|
|
213
213
|
- lib/onfido/models/document_odp_reasons.rb
|
214
214
|
- lib/onfido/models/document_properties.rb
|
215
215
|
- lib/onfido/models/document_properties_address_lines.rb
|
216
|
-
- lib/onfido/models/
|
216
|
+
- lib/onfido/models/document_properties_barcode_inner.rb
|
217
217
|
- lib/onfido/models/document_properties_document_classification.rb
|
218
218
|
- lib/onfido/models/document_properties_document_numbers_inner.rb
|
219
219
|
- lib/onfido/models/document_properties_driving_licence_information.rb
|
@@ -452,6 +452,8 @@ files:
|
|
452
452
|
- spec/integrations/webhook_spec.rb
|
453
453
|
- spec/integrations/workflow_run_output_spec.rb
|
454
454
|
- spec/integrations/workflow_run_spec.rb
|
455
|
+
- spec/media/studio_webhook_event_with_list_in_output.json
|
456
|
+
- spec/media/studio_webhook_event_with_object_in_output.json
|
455
457
|
- spec/shared_contexts/with_applicant.rb
|
456
458
|
- spec/shared_contexts/with_check.rb
|
457
459
|
- spec/shared_contexts/with_document.rb
|
@@ -464,7 +466,7 @@ homepage: https://github.com/onfido/onfido-ruby
|
|
464
466
|
licenses:
|
465
467
|
- MIT
|
466
468
|
metadata: {}
|
467
|
-
post_install_message:
|
469
|
+
post_install_message:
|
468
470
|
rdoc_options: []
|
469
471
|
require_paths:
|
470
472
|
- lib
|
@@ -480,36 +482,38 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
480
482
|
version: '0'
|
481
483
|
requirements: []
|
482
484
|
rubygems_version: 3.1.6
|
483
|
-
signing_key:
|
485
|
+
signing_key:
|
484
486
|
specification_version: 4
|
485
487
|
summary: The official Ruby library for integrating with the Onfido API.
|
486
488
|
test_files:
|
487
489
|
- spec/classic_webhook_event_verifier_spec.rb
|
490
|
+
- spec/integrations/report_schema_spec.rb
|
488
491
|
- spec/integrations/sdk_token_spec.rb
|
489
|
-
- spec/integrations/
|
490
|
-
- spec/integrations/motion_capture_spec.rb
|
492
|
+
- spec/integrations/applicant_spec.rb
|
491
493
|
- spec/integrations/workflow_run_spec.rb
|
492
|
-
- spec/integrations/check_spec.rb
|
493
|
-
- spec/integrations/live_video_spec.rb
|
494
|
-
- spec/integrations/webhook_spec.rb
|
495
494
|
- spec/integrations/workflow_run_output_spec.rb
|
496
|
-
- spec/integrations/
|
497
|
-
- spec/integrations/address_picker_spec.rb
|
495
|
+
- spec/integrations/webhook_spec.rb
|
498
496
|
- spec/integrations/watchlist_monitor_spec.rb
|
499
|
-
- spec/integrations/
|
500
|
-
- spec/integrations/qualified_electronic_signature_spec.rb
|
501
|
-
- spec/integrations/report_schema_spec.rb
|
502
|
-
- spec/integrations/live_photo_spec.rb
|
503
|
-
- spec/integrations/report_spec.rb
|
497
|
+
- spec/integrations/live_video_spec.rb
|
504
498
|
- spec/integrations/document_spec.rb
|
499
|
+
- spec/integrations/live_photo_spec.rb
|
500
|
+
- spec/integrations/qualified_electronic_signature_spec.rb
|
501
|
+
- spec/integrations/motion_capture_spec.rb
|
502
|
+
- spec/integrations/address_picker_spec.rb
|
503
|
+
- spec/integrations/tasks_spec.rb
|
505
504
|
- spec/integrations/media/sample_photo.png
|
506
505
|
- spec/integrations/media/sample_driving_licence.png
|
506
|
+
- spec/integrations/check_spec.rb
|
507
|
+
- spec/integrations/id_photo_spec.rb
|
507
508
|
- spec/integrations/extraction_spec.rb
|
509
|
+
- spec/integrations/report_spec.rb
|
510
|
+
- spec/media/studio_webhook_event_with_object_in_output.json
|
511
|
+
- spec/media/studio_webhook_event_with_list_in_output.json
|
508
512
|
- spec/shared_contexts/with_document.rb
|
509
513
|
- spec/shared_contexts/with_check.rb
|
510
|
-
- spec/shared_contexts/with_live_photo.rb
|
511
514
|
- spec/shared_contexts/with_workflow_run.rb
|
512
515
|
- spec/shared_contexts/with_applicant.rb
|
516
|
+
- spec/shared_contexts/with_live_photo.rb
|
513
517
|
- spec/shared_contexts/with_onfido.rb
|
514
518
|
- spec/spec_helper.rb
|
515
519
|
- spec/studio_webhook_event_verifier_spec.rb
|