onfido 5.0.0 → 5.1.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 +16 -0
- data/README.md +2 -2
- data/lib/onfido/api/default_api.rb +63 -0
- data/lib/onfido/api_client.rb +1 -1
- data/lib/onfido/models/applicant_consent.rb +272 -0
- data/lib/onfido/models/device_intelligence_breakdown.rb +10 -1
- data/lib/onfido/models/device_intelligence_breakdown_breakdown.rb +1 -1
- data/lib/onfido/models/{device_intelligence_breakdown_breakdown_device.rb → device_intelligence_breakdown_device.rb} +4 -4
- data/lib/onfido/models/{device_intelligence_breakdown_breakdown_device_breakdown.rb → device_intelligence_breakdown_device_breakdown.rb} +3 -3
- data/lib/onfido/models/device_intelligence_breakdown_properties_device.rb +1 -1
- data/lib/onfido/models/device_intelligence_properties.rb +232 -0
- data/lib/onfido/models/device_intelligence_report.rb +13 -4
- data/lib/onfido/models/document_properties.rb +4 -2
- data/lib/onfido/models/{document_properties_driving_licence_information.rb → document_properties_driving_licence_information_item.rb} +3 -3
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties.rb +4 -2
- data/lib/onfido/models/webhook.rb +51 -1
- data/lib/onfido/models/webhook_builder.rb +51 -1
- data/lib/onfido/models/webhook_shared.rb +54 -4
- data/lib/onfido/models/webhook_updater.rb +51 -1
- data/lib/onfido/version.rb +1 -1
- data/lib/onfido.rb +5 -3
- data/spec/integrations/applicant_spec.rb +28 -0
- data/spec/integrations/report_schema_spec.rb +33 -0
- metadata +27 -25
@@ -27,6 +27,21 @@ module Onfido
|
|
27
27
|
# Webhook version used to control the payload object when sending webhooks.
|
28
28
|
attr_accessor :payload_version
|
29
29
|
|
30
|
+
# Determines if the webhook will fetch OAuth access tokens to send in the Authorization header.
|
31
|
+
attr_accessor :oauth_enabled
|
32
|
+
|
33
|
+
# The url to fetch the OAuth access token using client credentials grant.
|
34
|
+
attr_accessor :oauth_server_url
|
35
|
+
|
36
|
+
# The client id to authenticate the client credentials grant.
|
37
|
+
attr_accessor :oauth_server_client_id
|
38
|
+
|
39
|
+
# The client secret to authenticate the client credentials grant.
|
40
|
+
attr_accessor :oauth_server_client_secret
|
41
|
+
|
42
|
+
# The scopes to be sent when requesting the access token.
|
43
|
+
attr_accessor :oauth_server_scope
|
44
|
+
|
30
45
|
# The url that will listen to notifications (must be https).
|
31
46
|
attr_accessor :url
|
32
47
|
|
@@ -37,6 +52,11 @@ module Onfido
|
|
37
52
|
:'events' => :'events',
|
38
53
|
:'environments' => :'environments',
|
39
54
|
:'payload_version' => :'payload_version',
|
55
|
+
:'oauth_enabled' => :'oauth_enabled',
|
56
|
+
:'oauth_server_url' => :'oauth_server_url',
|
57
|
+
:'oauth_server_client_id' => :'oauth_server_client_id',
|
58
|
+
:'oauth_server_client_secret' => :'oauth_server_client_secret',
|
59
|
+
:'oauth_server_scope' => :'oauth_server_scope',
|
40
60
|
:'url' => :'url'
|
41
61
|
}
|
42
62
|
end
|
@@ -53,6 +73,11 @@ module Onfido
|
|
53
73
|
:'events' => :'Array<WebhookEventType>',
|
54
74
|
:'environments' => :'Array<String>',
|
55
75
|
:'payload_version' => :'Integer',
|
76
|
+
:'oauth_enabled' => :'Boolean',
|
77
|
+
:'oauth_server_url' => :'String',
|
78
|
+
:'oauth_server_client_id' => :'String',
|
79
|
+
:'oauth_server_client_secret' => :'String',
|
80
|
+
:'oauth_server_scope' => :'String',
|
56
81
|
:'url' => :'String'
|
57
82
|
}
|
58
83
|
end
|
@@ -106,6 +131,26 @@ module Onfido
|
|
106
131
|
self.payload_version = attributes[:'payload_version']
|
107
132
|
end
|
108
133
|
|
134
|
+
if attributes.key?(:'oauth_enabled')
|
135
|
+
self.oauth_enabled = attributes[:'oauth_enabled']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'oauth_server_url')
|
139
|
+
self.oauth_server_url = attributes[:'oauth_server_url']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'oauth_server_client_id')
|
143
|
+
self.oauth_server_client_id = attributes[:'oauth_server_client_id']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'oauth_server_client_secret')
|
147
|
+
self.oauth_server_client_secret = attributes[:'oauth_server_client_secret']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'oauth_server_scope')
|
151
|
+
self.oauth_server_scope = attributes[:'oauth_server_scope']
|
152
|
+
end
|
153
|
+
|
109
154
|
if attributes.key?(:'url')
|
110
155
|
self.url = attributes[:'url']
|
111
156
|
end
|
@@ -135,6 +180,11 @@ module Onfido
|
|
135
180
|
events == o.events &&
|
136
181
|
environments == o.environments &&
|
137
182
|
payload_version == o.payload_version &&
|
183
|
+
oauth_enabled == o.oauth_enabled &&
|
184
|
+
oauth_server_url == o.oauth_server_url &&
|
185
|
+
oauth_server_client_id == o.oauth_server_client_id &&
|
186
|
+
oauth_server_client_secret == o.oauth_server_client_secret &&
|
187
|
+
oauth_server_scope == o.oauth_server_scope &&
|
138
188
|
url == o.url
|
139
189
|
end
|
140
190
|
|
@@ -147,7 +197,7 @@ module Onfido
|
|
147
197
|
# Calculates hash code according to all attributes.
|
148
198
|
# @return [Integer] Hash code
|
149
199
|
def hash
|
150
|
-
[enabled, events, environments, payload_version, url].hash
|
200
|
+
[enabled, events, environments, payload_version, oauth_enabled, oauth_server_url, oauth_server_client_id, oauth_server_client_secret, oauth_server_scope, url].hash
|
151
201
|
end
|
152
202
|
|
153
203
|
# Builds the object from hash
|
data/lib/onfido/version.rb
CHANGED
data/lib/onfido.rb
CHANGED
@@ -23,6 +23,7 @@ require 'onfido/models/address_shared'
|
|
23
23
|
require 'onfido/models/addresses_list'
|
24
24
|
require 'onfido/models/applicant'
|
25
25
|
require 'onfido/models/applicant_builder'
|
26
|
+
require 'onfido/models/applicant_consent'
|
26
27
|
require 'onfido/models/applicant_consent_builder'
|
27
28
|
require 'onfido/models/applicant_consent_name'
|
28
29
|
require 'onfido/models/applicant_create'
|
@@ -44,12 +45,13 @@ require 'onfido/models/complete_task_data_builder'
|
|
44
45
|
require 'onfido/models/country_codes'
|
45
46
|
require 'onfido/models/device_intelligence_breakdown'
|
46
47
|
require 'onfido/models/device_intelligence_breakdown_breakdown'
|
47
|
-
require 'onfido/models/
|
48
|
-
require 'onfido/models/
|
48
|
+
require 'onfido/models/device_intelligence_breakdown_device'
|
49
|
+
require 'onfido/models/device_intelligence_breakdown_device_breakdown'
|
49
50
|
require 'onfido/models/device_intelligence_breakdown_properties'
|
50
51
|
require 'onfido/models/device_intelligence_breakdown_properties_device'
|
51
52
|
require 'onfido/models/device_intelligence_breakdown_properties_geolocation'
|
52
53
|
require 'onfido/models/device_intelligence_breakdown_properties_ip'
|
54
|
+
require 'onfido/models/device_intelligence_properties'
|
53
55
|
require 'onfido/models/device_intelligence_report'
|
54
56
|
require 'onfido/models/document'
|
55
57
|
require 'onfido/models/document_breakdown'
|
@@ -95,7 +97,7 @@ require 'onfido/models/document_properties_address_lines'
|
|
95
97
|
require 'onfido/models/document_properties_barcode_inner'
|
96
98
|
require 'onfido/models/document_properties_document_classification'
|
97
99
|
require 'onfido/models/document_properties_document_numbers_inner'
|
98
|
-
require 'onfido/models/
|
100
|
+
require 'onfido/models/document_properties_driving_licence_information_item'
|
99
101
|
require 'onfido/models/document_properties_extracted_data'
|
100
102
|
require 'onfido/models/document_properties_nfc'
|
101
103
|
require 'onfido/models/document_report'
|
@@ -80,6 +80,34 @@ describe Onfido::Applicant do
|
|
80
80
|
expect(updated_applicant.dob).to eq Date.parse('1968-04-08')
|
81
81
|
end
|
82
82
|
|
83
|
+
it 'lists applicant consents' do
|
84
|
+
new_applicant_data = Onfido::ApplicantUpdater.new(
|
85
|
+
'consents' => [{
|
86
|
+
'name' => Onfido::ApplicantConsentName::PRIVACY_NOTICES_READ,
|
87
|
+
'granted' => true
|
88
|
+
},
|
89
|
+
{
|
90
|
+
'name' => Onfido::ApplicantConsentName::SSN_VERIFICATION,
|
91
|
+
'granted' => true
|
92
|
+
},
|
93
|
+
{
|
94
|
+
'name' => Onfido::ApplicantConsentName::PHONE_NUMBER_VERIFICATION,
|
95
|
+
'granted' => true
|
96
|
+
}]
|
97
|
+
)
|
98
|
+
onfido_api.update_applicant(applicant_id, new_applicant_data)
|
99
|
+
|
100
|
+
expected_consents = [
|
101
|
+
have_attributes(name: "phone_number_verification", granted: true),
|
102
|
+
have_attributes(name: "privacy_notices_read", granted: true),
|
103
|
+
have_attributes(name: "ssn_verification", granted: true)
|
104
|
+
]
|
105
|
+
|
106
|
+
consents = onfido_api.find_applicant_consents(applicant_id)
|
107
|
+
expect(consents).to contain_exactly(*expected_consents)
|
108
|
+
|
109
|
+
end
|
110
|
+
|
83
111
|
it 'deletes an applicant' do
|
84
112
|
onfido_api.delete_applicant(applicant_id)
|
85
113
|
|
@@ -58,5 +58,38 @@ describe Onfido::Report do
|
|
58
58
|
expect(report.properties.barcode[0]).to be_an_instance_of Onfido::DocumentPropertiesBarcodeInner
|
59
59
|
expect(report.properties.barcode[0].document_type).to eq("driving_licence")
|
60
60
|
end
|
61
|
+
|
62
|
+
it 'schema of Document With Driving Lincence Information report is valid' do
|
63
|
+
report_id = onfido_api.create_check(
|
64
|
+
Onfido::CheckBuilder.new(
|
65
|
+
applicant_id: applicant_id,
|
66
|
+
document_ids: [document_id],
|
67
|
+
report_names: [Onfido::ReportName::DOCUMENT_WITH_DRIVING_LICENCE_INFORMATION],
|
68
|
+
)).report_ids[0]
|
69
|
+
|
70
|
+
report = repeat_request_until_status_changes(
|
71
|
+
Onfido::ReportStatus::COMPLETE
|
72
|
+
) { onfido_api.find_report(report_id) }
|
73
|
+
|
74
|
+
expect(report).to be_an_instance_of Onfido::DocumentWithDrivingLicenceInformationReport
|
75
|
+
expect(report.properties.driving_licence_information).not_to be_nil
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'schema of Device Intelligence report is valid' do
|
79
|
+
report_id = onfido_api.create_check(
|
80
|
+
Onfido::CheckBuilder.new(
|
81
|
+
applicant_id: applicant_id,
|
82
|
+
document_ids: [document_id],
|
83
|
+
report_names: [Onfido::ReportName::DEVICE_INTELLIGENCE],
|
84
|
+
)).report_ids[0]
|
85
|
+
|
86
|
+
report = repeat_request_until_status_changes(
|
87
|
+
Onfido::ReportStatus::COMPLETE
|
88
|
+
) { onfido_api.find_report(report_id) }
|
89
|
+
|
90
|
+
expect(report).to be_an_instance_of Onfido::DeviceIntelligenceReport
|
91
|
+
expect(report.breakdown).not_to be_nil
|
92
|
+
expect(report.properties).not_to be_nil
|
93
|
+
end
|
61
94
|
end
|
62
95
|
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: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI-Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/onfido/models/addresses_list.rb
|
145
145
|
- lib/onfido/models/applicant.rb
|
146
146
|
- lib/onfido/models/applicant_builder.rb
|
147
|
+
- lib/onfido/models/applicant_consent.rb
|
147
148
|
- lib/onfido/models/applicant_consent_builder.rb
|
148
149
|
- lib/onfido/models/applicant_consent_name.rb
|
149
150
|
- lib/onfido/models/applicant_create.rb
|
@@ -165,12 +166,13 @@ files:
|
|
165
166
|
- lib/onfido/models/country_codes.rb
|
166
167
|
- lib/onfido/models/device_intelligence_breakdown.rb
|
167
168
|
- lib/onfido/models/device_intelligence_breakdown_breakdown.rb
|
168
|
-
- lib/onfido/models/
|
169
|
-
- lib/onfido/models/
|
169
|
+
- lib/onfido/models/device_intelligence_breakdown_device.rb
|
170
|
+
- lib/onfido/models/device_intelligence_breakdown_device_breakdown.rb
|
170
171
|
- lib/onfido/models/device_intelligence_breakdown_properties.rb
|
171
172
|
- lib/onfido/models/device_intelligence_breakdown_properties_device.rb
|
172
173
|
- lib/onfido/models/device_intelligence_breakdown_properties_geolocation.rb
|
173
174
|
- lib/onfido/models/device_intelligence_breakdown_properties_ip.rb
|
175
|
+
- lib/onfido/models/device_intelligence_properties.rb
|
174
176
|
- lib/onfido/models/device_intelligence_report.rb
|
175
177
|
- lib/onfido/models/document.rb
|
176
178
|
- lib/onfido/models/document_breakdown.rb
|
@@ -216,7 +218,7 @@ files:
|
|
216
218
|
- lib/onfido/models/document_properties_barcode_inner.rb
|
217
219
|
- lib/onfido/models/document_properties_document_classification.rb
|
218
220
|
- lib/onfido/models/document_properties_document_numbers_inner.rb
|
219
|
-
- lib/onfido/models/
|
221
|
+
- lib/onfido/models/document_properties_driving_licence_information_item.rb
|
220
222
|
- lib/onfido/models/document_properties_extracted_data.rb
|
221
223
|
- lib/onfido/models/document_properties_nfc.rb
|
222
224
|
- lib/onfido/models/document_report.rb
|
@@ -488,33 +490,33 @@ specification_version: 4
|
|
488
490
|
summary: The official Ruby library for integrating with the Onfido API.
|
489
491
|
test_files:
|
490
492
|
- spec/classic_webhook_event_verifier_spec.rb
|
491
|
-
- spec/integrations/
|
492
|
-
- spec/integrations/
|
493
|
-
- spec/integrations/
|
494
|
-
- spec/integrations/
|
493
|
+
- spec/integrations/motion_capture_spec.rb
|
494
|
+
- spec/integrations/id_photo_spec.rb
|
495
|
+
- spec/integrations/check_spec.rb
|
496
|
+
- spec/integrations/live_photo_spec.rb
|
495
497
|
- spec/integrations/watchlist_monitor_spec.rb
|
496
|
-
- spec/integrations/
|
498
|
+
- spec/integrations/workflow_run_output_spec.rb
|
499
|
+
- spec/integrations/media/sample_photo.png
|
500
|
+
- spec/integrations/media/sample_driving_licence.png
|
501
|
+
- spec/integrations/live_video_spec.rb
|
502
|
+
- spec/integrations/document_spec.rb
|
503
|
+
- spec/integrations/webhook_spec.rb
|
497
504
|
- spec/integrations/applicant_spec.rb
|
505
|
+
- spec/integrations/address_picker_spec.rb
|
506
|
+
- spec/integrations/workflow_run_spec.rb
|
498
507
|
- spec/integrations/qualified_electronic_signature_spec.rb
|
499
|
-
- spec/integrations/
|
508
|
+
- spec/integrations/report_schema_spec.rb
|
509
|
+
- spec/integrations/sdk_token_spec.rb
|
510
|
+
- spec/integrations/tasks_spec.rb
|
500
511
|
- spec/integrations/report_spec.rb
|
501
|
-
- spec/integrations/media/sample_driving_licence.png
|
502
|
-
- spec/integrations/media/sample_photo.png
|
503
512
|
- spec/integrations/extraction_spec.rb
|
504
|
-
- spec/integrations/webhook_spec.rb
|
505
|
-
- spec/integrations/check_spec.rb
|
506
|
-
- spec/integrations/live_video_spec.rb
|
507
|
-
- spec/integrations/id_photo_spec.rb
|
508
|
-
- spec/integrations/workflow_run_spec.rb
|
509
|
-
- spec/integrations/document_spec.rb
|
510
|
-
- spec/integrations/live_photo_spec.rb
|
511
|
-
- spec/media/studio_webhook_event_with_list_in_output.json
|
512
513
|
- spec/media/studio_webhook_event_with_object_in_output.json
|
513
|
-
- spec/
|
514
|
-
- spec/shared_contexts/with_onfido.rb
|
514
|
+
- spec/media/studio_webhook_event_with_list_in_output.json
|
515
515
|
- spec/shared_contexts/with_applicant.rb
|
516
|
-
- spec/shared_contexts/with_document.rb
|
517
|
-
- spec/shared_contexts/with_workflow_run.rb
|
518
516
|
- spec/shared_contexts/with_check.rb
|
517
|
+
- spec/shared_contexts/with_workflow_run.rb
|
518
|
+
- spec/shared_contexts/with_onfido.rb
|
519
|
+
- spec/shared_contexts/with_live_photo.rb
|
520
|
+
- spec/shared_contexts/with_document.rb
|
519
521
|
- spec/spec_helper.rb
|
520
522
|
- spec/studio_webhook_event_verifier_spec.rb
|