onfido 2.6.0 → 2.8.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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +2 -2
  3. data/CHANGELOG.md +9 -0
  4. data/README.md +1 -1
  5. data/lib/onfido/api.rb +4 -0
  6. data/lib/onfido/options.rb +1 -1
  7. data/lib/onfido/resource.rb +8 -0
  8. data/lib/onfido/resources/monitor.rb +8 -0
  9. data/lib/onfido/resources/workflow_run.rb +17 -0
  10. data/lib/onfido/version.rb +1 -1
  11. data/lib/onfido.rb +1 -0
  12. data/spec/integrations/applicant_spec.rb +1 -1
  13. data/spec/integrations/monitor_spec.rb +62 -2
  14. data/spec/integrations/workflow_run_spec.rb +46 -0
  15. data/spec/onfido/options_spec.rb +1 -1
  16. data/spec/support/fake_onfido_api.rb +81 -44
  17. data/spec/support/fixtures/applicant.json +1 -1
  18. data/spec/support/fixtures/check.json +1 -1
  19. data/spec/support/fixtures/checks.json +1 -1
  20. data/spec/support/fixtures/document.json +1 -1
  21. data/spec/support/fixtures/documents.json +2 -2
  22. data/spec/support/fixtures/live_photo.json +2 -2
  23. data/spec/support/fixtures/live_photos.json +4 -4
  24. data/spec/support/fixtures/live_video.json +2 -2
  25. data/spec/support/fixtures/live_videos.json +2 -2
  26. data/spec/support/fixtures/monitor_matches.json +12 -0
  27. data/spec/support/fixtures/motion_capture.json +2 -2
  28. data/spec/support/fixtures/motion_captures.json +2 -2
  29. data/spec/support/fixtures/report.json +1 -1
  30. data/spec/support/fixtures/reports.json +2 -2
  31. data/spec/support/fixtures/webhook.json +1 -1
  32. data/spec/support/fixtures/webhooks.json +2 -2
  33. data/spec/support/fixtures/workflow_run.json +20 -0
  34. data/spec/support/fixtures/workflow_runs.json +42 -0
  35. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74a5e178fa210205846555dbb0f870b21830bae9a44bbf36bd2f095f4c12bc7e
4
- data.tar.gz: 605d4d740f4a73db842ca05592d34d1170e565ccbc5ee2c580a1f131968673fa
3
+ metadata.gz: 38b8a8f0808cfd6cd4df9d3853705ae0b432136e28d8a0cd8712c353f61a2063
4
+ data.tar.gz: c205a16862973f2bfe582aae44e58f4aa6d36ebd31647535e7151104b798f8ee
5
5
  SHA512:
6
- metadata.gz: e31930f8a4e9a856e72753420801ada047f159ae6444648440cde21008270f068ccce793974c5361cd26f538ec51b52ceb2a76ea63af2249629e8d27c056ca8f
7
- data.tar.gz: 03dd7a20bb4d1e6fcad6b1f9a3a79c1238bc2e966395f35bb4509ce5987f10eb1d602a2327f19a15bad558be1491d9f3f2137022785909352a5c028f8c9f6e99
6
+ metadata.gz: 30a055206b8ac359f93f45584edd9a751390f381bc11caabdee05cf5b13f06c71a79388753ec6e680672c274b1fd08604334af75b9c4465cfab651d7e6f36e36
7
+ data.tar.gz: 5a887ab3f679946ce049ad3b4ba4bf874c31f641d437019df2093fe8f734ebebc29f6cca15b2b730ac47d14480e1ce239107ac5a6ce3fa639a71c8c78494b373
@@ -15,9 +15,9 @@ jobs:
15
15
  steps:
16
16
  - uses: actions/checkout@v2
17
17
  - name: Set up Ruby 2.6
18
- uses: actions/setup-ruby@v1
18
+ uses: ruby/setup-ruby@v1
19
19
  with:
20
- ruby-version: 2.6.x
20
+ ruby-version: 2.6
21
21
 
22
22
  - name: Publish to RubyGems
23
23
  run: |
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## v2.8.0, 24 January 2023
2
+
3
+ - Updated to use API v3.6, for more details please see our [release notes](https://developers.onfido.com/release-notes#api-v36).
4
+ - Add Monitor support
5
+
6
+ ## v2.7.0, 22 November 2022
7
+
8
+ - Added support for [Workflow Runs](https://documentation.onfido.com/#workflow-runs)
9
+
1
10
  ## v2.6.0, 22 November 2022
2
11
 
3
12
  - Added support for [Monitors](https://documentation.onfido.com/#monitors)
data/README.md CHANGED
@@ -7,7 +7,7 @@ The official Ruby library for integrating with the Onfido API.
7
7
 
8
8
  Documentation can be found at https://documentation.onfido.com
9
9
 
10
- This version uses Onfido API v3.5 and is compatible with Ruby 2.4 onwards. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API.
10
+ This version uses Onfido API v3.6 and is compatible with Ruby 2.4 onwards. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API.
11
11
 
12
12
  ## Installation
13
13
 
data/lib/onfido/api.rb CHANGED
@@ -54,6 +54,10 @@ module Onfido
54
54
  @extraction ||= Onfido::Extraction.new(options)
55
55
  end
56
56
 
57
+ def workflow_run
58
+ @workflow_run ||= Onfido::WorkflowRun.new(options)
59
+ end
60
+
57
61
  private
58
62
 
59
63
  attr_reader :options
@@ -32,7 +32,7 @@ module Onfido
32
32
  attr_reader :api_key, :open_timeout, :read_timeout
33
33
 
34
34
  def base_url
35
- @unknown_api_url || "https://api.#{@region}.onfido.com/v3.5/"
35
+ @unknown_api_url || "https://api.#{@region}.onfido.com/v3.6/"
36
36
  end
37
37
  end
38
38
  end
@@ -29,6 +29,10 @@ module Onfido
29
29
  handle_request { rest_client[path].put(payload.to_json, ADDITIONAL_HEADERS) }
30
30
  end
31
31
 
32
+ def patch(path:, payload: nil)
33
+ handle_request { rest_client[path].patch(payload.to_json, ADDITIONAL_HEADERS) }
34
+ end
35
+
32
36
  def delete(path:)
33
37
  handle_request { rest_client[path].delete(ADDITIONAL_HEADERS) }
34
38
  end
@@ -141,5 +145,9 @@ module Onfido
141
145
  raise ArgumentError, 'File must be a `File`-like object which responds to ' \
142
146
  '`#read` and `#path`'
143
147
  end
148
+
149
+ def stringify_query_params(hashed_params)
150
+ URI.encode_www_form_component(hashed_params.map{ |k,v| "#{k}=#{v}" }.join("&"))
151
+ end
144
152
  end
145
153
  end
@@ -20,5 +20,13 @@ module Onfido
20
20
  def destroy(monitor_id)
21
21
  delete(path: "watchlist_monitors/#{monitor_id}")
22
22
  end
23
+
24
+ def list_matches(monitor_id)
25
+ get(path: "watchlist_monitors/#{monitor_id}/matches")
26
+ end
27
+
28
+ def set_match_status(monitor_id, **payload)
29
+ patch(path: "watchlist_monitors/#{monitor_id}/matches", payload: payload)
30
+ end
23
31
  end
24
32
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Onfido
4
+ class WorkflowRun < Resource
5
+ def create(payload)
6
+ post(path: 'workflow_runs', payload: payload)
7
+ end
8
+
9
+ def find(workflow_run_id)
10
+ get(path: "workflow_runs/#{workflow_run_id}")
11
+ end
12
+
13
+ def all(query_params = {})
14
+ get(path: "workflow_runs?#{stringify_query_params(query_params)}")
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onfido
4
- VERSION = '2.6.0'
4
+ VERSION = '2.8.0'
5
5
  end
data/lib/onfido.rb CHANGED
@@ -25,6 +25,7 @@ require 'onfido/resources/motion_capture'
25
25
  require 'onfido/resources/report'
26
26
  require 'onfido/resources/sdk_token'
27
27
  require 'onfido/resources/webhook'
28
+ require 'onfido/resources/workflow_run'
28
29
 
29
30
  module Onfido
30
31
  end
@@ -39,7 +39,7 @@ describe Onfido::Applicant do
39
39
 
40
40
  it 'serializes the payload correctly' do
41
41
  WebMock.after_request do |request_signature, _response|
42
- if request_signature.uri.path == 'v3.5/applicants'
42
+ if request_signature.uri.path == 'v3.6/applicants'
43
43
  expect(Rack::Utils.parse_nested_query(request_signature.body))
44
44
  .to eq(params)
45
45
  end
@@ -34,7 +34,67 @@ describe Onfido::Monitor do
34
34
  end
35
35
  end
36
36
 
37
- it 'returns success code' do
38
- expect { monitor.destroy(monitor_id) }.not_to raise_error
37
+ describe '#destroy' do
38
+ it 'returns success code' do
39
+ expect { monitor.destroy(monitor_id) }.not_to raise_error
40
+ end
41
+ end
42
+
43
+ describe '#list_matches' do
44
+ subject(:list_matches) { monitor.list_matches(monitor_id) }
45
+
46
+ it do
47
+ is_expected
48
+ .to include('matches' => [hash_including('id' => anything, 'enabled' => true), anything])
49
+ end
50
+
51
+ context 'when the monitor_id does not exist' do
52
+ let(:monitor_id) { '00000000-c6b8-4c1e-a383-21efa241ce1e' }
53
+
54
+ it 'raises an error' do
55
+ expect { list_matches }.to raise_error(Onfido::RequestError, /404/)
56
+ end
57
+ end
58
+ end
59
+
60
+ describe '#set_match_status' do
61
+ subject(:set_match_status) { monitor.set_match_status(monitor_id, **payload) }
62
+
63
+ let(:payload) do
64
+ {
65
+ disabled: ['925e47d3-9e21-48d4-b570-9564c4282cec'],
66
+ enabled: ['37afcacb-5ff0-4b09-831d-5bcc672ca1fb']
67
+ }
68
+ end
69
+
70
+ it do
71
+ is_expected
72
+ .to include('matches' => [hash_including('id' => anything, 'enabled' => true), anything])
73
+ end
74
+
75
+ context 'when a match id is both in enabled and disabled' do
76
+ before { payload[:disabled] << payload[:enabled][0] }
77
+
78
+ it 'raises an error' do
79
+ expect { set_match_status }
80
+ .to raise_error(
81
+ an_instance_of(Onfido::RequestError).and(having_attributes(response_code: 422))
82
+ )
83
+ end
84
+ end
85
+
86
+ context 'when not passing any enabled or disabled ids' do
87
+ let(:payload) { {} }
88
+
89
+ it { is_expected.to be_nil }
90
+ end
91
+
92
+ context 'when the monitor_id does not exist' do
93
+ let(:monitor_id) { '00000000-c6b8-4c1e-a383-21efa241ce1e' }
94
+
95
+ it 'raises an error' do
96
+ expect { set_match_status }.to raise_error(Onfido::RequestError, /404/)
97
+ end
98
+ end
39
99
  end
40
100
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe Onfido::WorkflowRun do
4
+ include_context 'fake onfido api'
5
+
6
+ subject(:workflow_run) { onfido.workflow_run }
7
+
8
+ let(:workflow_run_id) { 'fcb73186-0733-4f6f-9c57-d9d5ef979443' }
9
+ let(:params) do
10
+ {
11
+ 'a' => 'b'
12
+ }
13
+ end
14
+
15
+ describe '#create' do
16
+ it 'serializes the payload correctly' do
17
+ WebMock.after_request do |request_signature, _response|
18
+ if request_signature.uri.path == 'v3.6/workflow_run'
19
+ expect(Rack::Utils.parse_nested_query(request_signature.body))
20
+ .to eq(params)
21
+ end
22
+ end
23
+ end
24
+
25
+ it 'creates a workflow run' do
26
+ response = workflow_run.create(params)
27
+ expect(response['id']).not_to be_nil
28
+ end
29
+ end
30
+
31
+ describe '#find' do
32
+ it 'returns the workflow run' do
33
+ response = workflow_run.find(workflow_run_id)
34
+
35
+ expect(response['id']).to eq(workflow_run_id)
36
+ end
37
+ end
38
+
39
+ describe '#all' do
40
+ it 'returns the workflow runs' do
41
+ response = workflow_run.all({ page: 1, sort: "asc" })
42
+
43
+ expect(response.count).to eq(2)
44
+ end
45
+ end
46
+ end
@@ -26,7 +26,7 @@ describe Onfido::Options do
26
26
  end
27
27
 
28
28
  it 'configures with region' do
29
- expect(rest_client.url).to eq 'https://api.us.onfido.com/v3.5/'
29
+ expect(rest_client.url).to eq 'https://api.us.onfido.com/v3.6/'
30
30
  end
31
31
 
32
32
  it 'configures with timeouts' do
@@ -19,32 +19,32 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
19
19
  end
20
20
  end
21
21
 
22
- get '/v3.5/addresses/pick' do
22
+ get '/v3.6/addresses/pick' do
23
23
  json_response(200, 'addresses.json')
24
24
  end
25
25
 
26
- post '/v3.5/applicants' do
26
+ post '/v3.6/applicants' do
27
27
  json_response(201, 'applicant.json')
28
28
  end
29
29
 
30
- put '/v3.5/applicants/:id' do
30
+ put '/v3.6/applicants/:id' do
31
31
  json_response(200, 'applicant.json')
32
32
  end
33
33
 
34
- get '/v3.5/applicants/:id' do
34
+ get '/v3.6/applicants/:id' do
35
35
  json_response(200, 'applicant.json')
36
36
  end
37
37
 
38
- get '/v3.5/applicants' do
38
+ get '/v3.6/applicants' do
39
39
  response = json_response(200, 'applicants.json')
40
40
  { applicants: JSON.parse(response)['applicants'][pagination_range] }.to_json
41
41
  end
42
42
 
43
- delete '/v3.5/applicants/:id' do
43
+ delete '/v3.6/applicants/:id' do
44
44
  status 204
45
45
  end
46
46
 
47
- post '/v3.5/applicants/:id/restore' do
47
+ post '/v3.6/applicants/:id/restore' do
48
48
  if params['id'] == 'a2fb9c62-ab10-4898-a8ec-342c4b552ad5'
49
49
  json_response(422, 'not_scheduled_for_deletion_error.json')
50
50
  else
@@ -52,37 +52,37 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
52
52
  end
53
53
  end
54
54
 
55
- post '/v3.5/documents' do
55
+ post '/v3.6/documents' do
56
56
  json_response(201, 'document.json')
57
57
  end
58
58
 
59
- post '/v3.5/extractions' do
59
+ post '/v3.6/extractions' do
60
60
  json_response(201, 'extraction.json')
61
61
  end
62
62
 
63
- get '/v3.5/documents/:id' do
63
+ get '/v3.6/documents/:id' do
64
64
  json_response(200, 'document.json')
65
65
  end
66
66
 
67
- get '/v3.5/documents' do
67
+ get '/v3.6/documents' do
68
68
  json_response(200, 'documents.json')
69
69
  end
70
70
 
71
- get '/v3.5/documents/:id/download' do
71
+ get '/v3.6/documents/:id/download' do
72
72
  status 200
73
73
  content_type 'application/octet-stream'
74
74
  "\x01\x02\x03" # acts as binary file data
75
75
  end
76
76
 
77
- post '/v3.5/live_photos' do
77
+ post '/v3.6/live_photos' do
78
78
  json_response(201, 'live_photo.json')
79
79
  end
80
80
 
81
- get '/v3.5/live_photos/:id' do
81
+ get '/v3.6/live_photos/:id' do
82
82
  json_response(200, 'live_photo.json')
83
83
  end
84
84
 
85
- get '/v3.5/live_photos' do
85
+ get '/v3.6/live_photos' do
86
86
  if params['applicant_id'] == '1030303-123123-123123'
87
87
  json_response(200, 'live_photos.json')
88
88
  else
@@ -90,17 +90,17 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
90
90
  end
91
91
  end
92
92
 
93
- get '/v3.5/live_photos/:id/download' do
93
+ get '/v3.6/live_photos/:id/download' do
94
94
  status 200
95
95
  content_type 'image/jpeg'
96
96
  "\x01\x02\x03" # acts as binary file data
97
97
  end
98
98
 
99
- get '/v3.5/live_videos/:id' do
99
+ get '/v3.6/live_videos/:id' do
100
100
  json_response(200, 'live_video.json')
101
101
  end
102
102
 
103
- get '/v3.5/live_videos' do
103
+ get '/v3.6/live_videos' do
104
104
  if params['applicant_id'] == '1030303-123123-123123'
105
105
  json_response(200, 'live_videos.json')
106
106
  else
@@ -108,21 +108,21 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
108
108
  end
109
109
  end
110
110
 
111
- get '/v3.5/live_videos/:id/download' do
111
+ get '/v3.6/live_videos/:id/download' do
112
112
  status 200
113
113
  content_type 'video/quicktime'
114
114
  "\x01\x02\x03" # acts as binary file data
115
115
  end
116
116
 
117
- post '/v3.5/watchlist_monitors' do
117
+ post '/v3.6/watchlist_monitors' do
118
118
  json_response(201, 'monitor.json')
119
119
  end
120
120
 
121
- get '/v3.5/watchlist_monitors/:id' do
121
+ get '/v3.6/watchlist_monitors/:id' do
122
122
  json_response(200, 'monitor.json')
123
123
  end
124
124
 
125
- get '/v3.5/watchlist_monitors' do
125
+ get '/v3.6/watchlist_monitors' do
126
126
  if params['applicant_id'] == '1030303-123123-123123'
127
127
  json_response(200, 'monitors.json')
128
128
  else
@@ -130,15 +130,40 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
130
130
  end
131
131
  end
132
132
 
133
- delete '/v3.5/watchlist_monitors/:id' do
133
+ delete '/v3.6/watchlist_monitors/:id' do
134
134
  status 204
135
135
  end
136
136
 
137
- get '/v3.5/motion_captures/:id' do
137
+ get '/v3.6/watchlist_monitors/:monitor_id/matches' do
138
+ if params['monitor_id'] == '2748c4fc-c6b8-4c1e-a383-21efa241ce1e'
139
+ json_response(200, 'monitor_matches.json')
140
+ else
141
+ status 404
142
+ end
143
+ end
144
+
145
+ patch '/v3.6/watchlist_monitors/:monitor_id/matches' do
146
+ if params['monitor_id'] == '2748c4fc-c6b8-4c1e-a383-21efa241ce1e'
147
+ enabled, disabled = params.values_at('enabled', 'disabled')
148
+ if enabled&.any? || disabled&.any?
149
+ if (enabled.to_a & disabled.to_a).any?
150
+ json_response(422, '4xx_response.json')
151
+ else
152
+ json_response(200, 'monitor_matches.json')
153
+ end
154
+ else
155
+ status 204
156
+ end
157
+ else
158
+ status 404
159
+ end
160
+ end
161
+
162
+ get '/v3.6/motion_captures/:id' do
138
163
  json_response(200, 'motion_capture.json')
139
164
  end
140
165
 
141
- get '/v3.5/motion_captures' do
166
+ get '/v3.6/motion_captures' do
142
167
  if params['applicant_id'] == '1030303-123123-123123'
143
168
  json_response(200, 'motion_captures.json')
144
169
  else
@@ -146,85 +171,97 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
146
171
  end
147
172
  end
148
173
 
149
- get '/v3.5/motion_captures/:id/download' do
174
+ get '/v3.6/motion_captures/:id/download' do
150
175
  status 200
151
176
  content_type 'video/mp4'
152
177
  "\x01\x02\x03" # acts as binary file data
153
178
  end
154
179
 
155
- get '/v3.5/motion_captures/:id/frame' do
180
+ get '/v3.6/motion_captures/:id/frame' do
156
181
  status 200
157
182
  content_type 'image/jpeg'
158
183
  "\x01\x02\x03" # acts as binary file data
159
184
  end
160
185
 
161
- post '/v3.5/checks' do
186
+ post '/v3.6/checks' do
162
187
  params['applicant_id'].nil? ? status(422) : json_response(201, 'check.json')
163
188
  end
164
189
 
165
- get '/v3.5/checks/:id' do
190
+ get '/v3.6/checks/:id' do
166
191
  json_response(200, 'check.json')
167
192
  end
168
193
 
169
- get '/v3.5/checks' do
194
+ get '/v3.6/checks' do
170
195
  json_response(200, 'checks.json')
171
196
  end
172
197
 
173
- post '/v3.5/checks/:id/resume' do
198
+ post '/v3.6/checks/:id/resume' do
174
199
  status 204 # no_content
175
200
  end
176
201
 
177
- get '/v3.5/checks/:id/download' do
202
+ get '/v3.6/checks/:id/download' do
178
203
  status 200
179
204
  content_type 'application/pdf'
180
205
  "\x01\x02\x03" # acts as binary file data
181
206
  end
182
207
 
183
- get '/v3.5/reports' do
208
+ get '/v3.6/reports' do
184
209
  json_response(200, 'reports.json')
185
210
  end
186
211
 
187
- get '/v3.5/reports/:id' do
212
+ get '/v3.6/reports/:id' do
188
213
  json_response(200, 'report.json')
189
214
  end
190
215
 
191
- post '/v3.5/reports/:id/resume' do
216
+ post '/v3.6/reports/:id/resume' do
192
217
  status 204
193
218
  end
194
219
 
195
- post '/v3.5/reports/:id/cancel' do
220
+ post '/v3.6/reports/:id/cancel' do
196
221
  status 204
197
222
  end
198
223
 
199
- post '/v3.5/sdk_token' do
224
+ post '/v3.6/sdk_token' do
200
225
  json_response(201, 'sdk_token.json')
201
226
  end
202
227
 
203
- post '/v3.5/webhooks' do
228
+ post '/v3.6/webhooks' do
204
229
  json_response(201, 'webhook.json')
205
230
  end
206
231
 
207
- get '/v3.5/webhooks/:id' do
232
+ get '/v3.6/webhooks/:id' do
208
233
  json_response(200, 'webhook.json')
209
234
  end
210
235
 
211
- delete '/v3.5/webhooks/:id' do
236
+ delete '/v3.6/webhooks/:id' do
212
237
  status 204
213
238
  end
214
239
 
215
- get '/v3.5/webhooks' do
240
+ get '/v3.6/webhooks' do
216
241
  json_response(200, 'webhooks.json')
217
242
  end
218
243
 
219
- get '/v3.5/4xx_response' do
244
+ post '/v3.6/workflow_runs' do
245
+ json_response(201, 'workflow_run.json')
246
+ end
247
+
248
+ get '/v3.6/workflow_runs/:id' do
249
+ json_response(200, 'workflow_run.json')
250
+ end
251
+
252
+ get '/v3.6/workflow_runs' do
253
+ json_response(200, 'workflow_runs.json')
254
+ end
255
+
256
+ get '/v3.6/4xx_response' do
220
257
  json_response(422, '4xx_response.json')
221
258
  end
222
259
 
223
- get '/v3.5/unexpected_error_format' do
260
+ get '/v3.6/unexpected_error_format' do
224
261
  json_response(400, 'unexpected_error_format.json')
225
262
  end
226
263
 
227
- get '/v3.5/unparseable_response' do
264
+ get '/v3.6/unparseable_response' do
228
265
  content_type :json
229
266
  status 504
230
267
  ''
@@ -7,7 +7,7 @@
7
7
  "last_name":"Bing",
8
8
  "email":"chandler_bing_6@friends.com",
9
9
  "dob":"1968-04-08",
10
- "href":"/v3.5/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
10
+ "href":"/v3.6/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
11
11
  "id_numbers":[],
12
12
  "address": {
13
13
  "flat_number":"4",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "8546921-123123-123123",
3
3
  "created_at": "2019-05-23T13:50:33Z",
4
- "href": "/v3.5/checks/8546921-123123-123123",
4
+ "href": "/v3.6/checks/8546921-123123-123123",
5
5
  "applicant_provides_data": "false",
6
6
  "status": "in_progress",
7
7
  "result": "pending",
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "id": "8546921-123123-123123",
5
5
  "created_at": "2019-11-23T13:50:33Z",
6
- "href": "/v3.5/checks/8546921-123123-123123",
6
+ "href": "/v3.6/checks/8546921-123123-123123",
7
7
  "applicant_provides_data": "false",
8
8
  "status": "in_progress",
9
9
  "result": "pending",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "7568415-123123-123123",
3
3
  "created_at": "2019-11-23 13:50:33Z",
4
- "href": "/v3.5/documents/7568415-123123-123123",
4
+ "href": "/v3.6/documents/7568415-123123-123123",
5
5
  "file_name": "passport.jpg",
6
6
  "file_type": "png",
7
7
  "file_size": 282870,
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "id": "7568415-123123-123123",
5
5
  "created_at": "2019-11-23 13:50:33Z",
6
- "href": "/v3.5/documents/7568415-123123-123123",
6
+ "href": "/v3.6/documents/7568415-123123-123123",
7
7
  "file_name": "passport.jpg",
8
8
  "file_type": "png",
9
9
  "file_size": 282870,
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "id": "121122-123123-123123",
14
14
  "created_at": "2019-11-23 13:50:40Z",
15
- "href": "/v3.5/documents/7568415-123123-123123",
15
+ "href": "/v3.6/documents/7568415-123123-123123",
16
16
  "file_name": "driving_licence.png",
17
17
  "file_type": "png",
18
18
  "file_size": 282870,
@@ -4,6 +4,6 @@
4
4
  "file_name": "onfido_captured_image.jpg",
5
5
  "file_type": "image/jpeg",
6
6
  "file_size": 47544,
7
- "href": "/v3.5/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
- "download_href": "/v3.5/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
7
+ "href": "/v3.6/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
+ "download_href": "/v3.6/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
9
9
  }
@@ -6,8 +6,8 @@
6
6
  "file_name": "onfido_captured_image.jpg",
7
7
  "file_type": "image/jpeg",
8
8
  "file_size": 47544,
9
- "href": "/v3.5/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
- "download_href": "/v3.5/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
9
+ "href": "/v3.6/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
+ "download_href": "/v3.6/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
11
11
  },
12
12
  {
13
13
  "id": "5134c12a-555a-1234-5e12-9d34fcbc11ba",
@@ -15,8 +15,8 @@
15
15
  "file_name": "onfido_captured_image.jpg",
16
16
  "file_type": "image/jpeg",
17
17
  "file_size": 47544,
18
- "href": "/v3.5/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
- "download_href": "/v3.5/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
18
+ "href": "/v3.6/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
+ "download_href": "/v3.6/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
20
20
  }
21
21
  ]
22
22
  }
@@ -18,6 +18,6 @@
18
18
  "file_name" : "output-29-05-2018_11_00_24.mov",
19
19
  "file_type" : "video/quicktime",
20
20
  "file_size" : 3348421,
21
- "href" : "/v3.5/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
- "download_href" : "/v3.5/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
21
+ "href" : "/v3.6/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
+ "download_href" : "/v3.6/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
23
23
  }
@@ -16,11 +16,11 @@
16
16
  }
17
17
  ],
18
18
  "created_at": "2019-11-29T09:00:39Z",
19
- "download_href": "/v3.5/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
19
+ "download_href": "/v3.6/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
20
20
  "file_name": "output-29-11-2019_11_00_24.mov",
21
21
  "file_size": 3348421,
22
22
  "file_type": "video/quicktime",
23
- "href": "/v3.5/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
23
+ "href": "/v3.6/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
24
24
  "id": "c9701e9b-83aa-442f-995b-20320ee8fb01"
25
25
  }
26
26
  ]
@@ -0,0 +1,12 @@
1
+ {
2
+ "matches": [
3
+ {
4
+ "id": "37afcacb-5ff0-4b09-831d-5bcc672ca1fb",
5
+ "enabled": true
6
+ },
7
+ {
8
+ "id": "925e47d3-9e21-48d4-b570-9564c4282cec",
9
+ "enabled": false
10
+ }
11
+ ]
12
+ }
@@ -4,6 +4,6 @@
4
4
  "file_name" : "motion_capture.mp4",
5
5
  "file_type" : "video/mp4",
6
6
  "file_size" : 2437112,
7
- "href" : "/v3.5/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6",
8
- "download_href" : "/v3.5/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6/download"
7
+ "href" : "/v3.6/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6",
8
+ "download_href" : "/v3.6/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6/download"
9
9
  }
@@ -6,8 +6,8 @@
6
6
  "file_name" : "motion_capture.mp4",
7
7
  "file_type" : "video/mp4",
8
8
  "file_size" : 2437112,
9
- "href" : "/v3.5/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6",
10
- "download_href" : "/v3.5/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6/download"
9
+ "href" : "/v3.6/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6",
10
+ "download_href" : "/v3.6/motion_captures/b1ae05b7-fb12-47c3-971c-311b56fc8de6/download"
11
11
  }
12
12
  ]
13
13
  }
@@ -4,7 +4,7 @@
4
4
  "created_at": "2019-11-23T13:50:45Z",
5
5
  "status": "in_progress",
6
6
  "result": "pending",
7
- "href": "/v3.5/reports/6951786-123123-422221",
7
+ "href": "/v3.6/reports/6951786-123123-422221",
8
8
  "breakdown": {},
9
9
  "properties": {}
10
10
  }
@@ -6,7 +6,7 @@
6
6
  "created_at": "2019-11-23T13:50:45Z",
7
7
  "status": "in_progress",
8
8
  "result": "pending",
9
- "href": "/v3.5/reports/6951786-123123-422221",
9
+ "href": "/v3.6/reports/6951786-123123-422221",
10
10
  "breakdown": {},
11
11
  "properties": {}
12
12
  },
@@ -16,7 +16,7 @@
16
16
  "created_at": "2019-11-23T13:50:45Z",
17
17
  "status": "in_progress",
18
18
  "result": "pending",
19
- "href": "/v3.5/reports/6951786-123123-316712",
19
+ "href": "/v3.6/reports/6951786-123123-316712",
20
20
  "breakdown": {},
21
21
  "properties": {}
22
22
  }
@@ -3,7 +3,7 @@
3
3
  "url": "https://webhookendpoint.url",
4
4
  "token": "yV85IsmuYwmjQGlZ",
5
5
  "enabled": true,
6
- "href": "/v3.5/webhooks/fcb73186-0733-4f6f-9c57-d9d5ef979443",
6
+ "href": "/v3.6/webhooks/fcb73186-0733-4f6f-9c57-d9d5ef979443",
7
7
  "environments": [
8
8
  "live"
9
9
  ],
@@ -4,7 +4,7 @@
4
4
  "id": "dd0a89e4-d44e-417a-aec4-01137d01ae59",
5
5
  "url": "https://demo.com",
6
6
  "enabled":false,
7
- "href": "/v3.5/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
7
+ "href": "/v3.6/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
8
8
  "environments": [
9
9
  "live"
10
10
  ],
@@ -18,7 +18,7 @@
18
18
  "id": "bfc727a8-f7bf-4073-b123-ed70a70f58e5",
19
19
  "url": "https://demo2.com",
20
20
  "enabled": true,
21
- "href": "/v3.5/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
21
+ "href": "/v3.6/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
22
22
  "environments": [
23
23
  "live"
24
24
  ],
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
3
+ "applicant_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
4
+ "workflow_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
5
+ "workflow_version_id": 11,
6
+ "status": "approved",
7
+ "dashboard_url":"https://dashboard.onfido.com/results/fcb73186-0733-4f6f-9c57-d9d5ef979443",
8
+ "output": {"prop1": "val_1", "prop2": 10},
9
+ "reasons": ["reason_1", "reason_2"],
10
+ "error": null,
11
+ "created_at": "2022-06-28T15:39:42Z",
12
+ "updated_at": "2022-07-28T15:40:42Z",
13
+ "link": {
14
+ "completed_redirect_url": "https://example.onfido.com",
15
+ "expired_redirect_url": "https://example.onfido.com",
16
+ "expires_at": "2022-10-17T14:40:50Z",
17
+ "language": "en_US",
18
+ "url": "https://eu.onfido.app/l/fcb73186-0733-4f6f-9c57-d9d5ef979443"
19
+ }
20
+ }
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
4
+ "applicant_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
5
+ "workflow_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
6
+ "workflow_version_id": 11,
7
+ "status": "approved",
8
+ "dashboard_url":"https://dashboard.onfido.com/results/fcb73186-0733-4f6f-9c57-d9d5ef979443",
9
+ "output": {"prop1": "val_1", "prop2": 10},
10
+ "reasons": ["reason_1", "reason_2"],
11
+ "error": null,
12
+ "created_at": "2022-06-28T15:39:42Z",
13
+ "updated_at": "2022-07-28T15:40:42Z",
14
+ "link": {
15
+ "completed_redirect_url": "https://example.onfido.com",
16
+ "expired_redirect_url": "https://example.onfido.com",
17
+ "expires_at": "2022-10-17T14:40:50Z",
18
+ "language": "en_US",
19
+ "url": "https://eu.onfido.app/l/fcb73186-0733-4f6f-9c57-d9d5ef979443"
20
+ }
21
+ },
22
+ {
23
+ "id": "fcb73186-0733-4f6f-9c57-d9d5ef979463",
24
+ "applicant_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
25
+ "workflow_id": "fcb73186-0733-4f6f-9c57-d9d5ef979443",
26
+ "workflow_version_id": 11,
27
+ "status": "approved",
28
+ "dashboard_url":"https://dashboard.onfido.com/results/fcb73186-0733-4f6f-9c57-d9d5ef979443",
29
+ "output": {"prop1": "val_1", "prop2": 10},
30
+ "reasons": ["reason_1", "reason_2"],
31
+ "error": null,
32
+ "created_at": "2022-06-28T15:39:42Z",
33
+ "updated_at": "2022-07-28T15:40:42Z",
34
+ "link": {
35
+ "completed_redirect_url": "https://example.onfido.com",
36
+ "expired_redirect_url": "https://example.onfido.com",
37
+ "expires_at": "2022-10-17T14:40:50Z",
38
+ "language": "en_US",
39
+ "url": "https://eu.onfido.app/l/fcb73186-0733-4f6f-9c57-d9d5ef979443"
40
+ }
41
+ }
42
+ ]
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: 2.6.0
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onfido
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -146,6 +146,7 @@ files:
146
146
  - lib/onfido/resources/report.rb
147
147
  - lib/onfido/resources/sdk_token.rb
148
148
  - lib/onfido/resources/webhook.rb
149
+ - lib/onfido/resources/workflow_run.rb
149
150
  - lib/onfido/version.rb
150
151
  - onfido.gemspec
151
152
  - spec/integrations/address_spec.rb
@@ -161,6 +162,7 @@ files:
161
162
  - spec/integrations/resource_spec.rb
162
163
  - spec/integrations/sdk_token_spec.rb
163
164
  - spec/integrations/webhook_spec.rb
165
+ - spec/integrations/workflow_run_spec.rb
164
166
  - spec/onfido/api_spec.rb
165
167
  - spec/onfido/connection_error_spec.rb
166
168
  - spec/onfido/options_spec.rb
@@ -181,6 +183,7 @@ files:
181
183
  - spec/support/fixtures/live_video.json
182
184
  - spec/support/fixtures/live_videos.json
183
185
  - spec/support/fixtures/monitor.json
186
+ - spec/support/fixtures/monitor_matches.json
184
187
  - spec/support/fixtures/monitors.json
185
188
  - spec/support/fixtures/motion_capture.json
186
189
  - spec/support/fixtures/motion_captures.json
@@ -191,6 +194,8 @@ files:
191
194
  - spec/support/fixtures/unexpected_error_format.json
192
195
  - spec/support/fixtures/webhook.json
193
196
  - spec/support/fixtures/webhooks.json
197
+ - spec/support/fixtures/workflow_run.json
198
+ - spec/support/fixtures/workflow_runs.json
194
199
  homepage: http://github.com/onfido/onfido-ruby
195
200
  licenses:
196
201
  - MIT
@@ -228,6 +233,7 @@ test_files:
228
233
  - spec/integrations/resource_spec.rb
229
234
  - spec/integrations/sdk_token_spec.rb
230
235
  - spec/integrations/webhook_spec.rb
236
+ - spec/integrations/workflow_run_spec.rb
231
237
  - spec/onfido/api_spec.rb
232
238
  - spec/onfido/connection_error_spec.rb
233
239
  - spec/onfido/options_spec.rb
@@ -248,6 +254,7 @@ test_files:
248
254
  - spec/support/fixtures/live_video.json
249
255
  - spec/support/fixtures/live_videos.json
250
256
  - spec/support/fixtures/monitor.json
257
+ - spec/support/fixtures/monitor_matches.json
251
258
  - spec/support/fixtures/monitors.json
252
259
  - spec/support/fixtures/motion_capture.json
253
260
  - spec/support/fixtures/motion_captures.json
@@ -258,3 +265,5 @@ test_files:
258
265
  - spec/support/fixtures/unexpected_error_format.json
259
266
  - spec/support/fixtures/webhook.json
260
267
  - spec/support/fixtures/webhooks.json
268
+ - spec/support/fixtures/workflow_run.json
269
+ - spec/support/fixtures/workflow_runs.json