onfido 2.0.2 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7983a2913b8ae4c7a1e53d92b8b62028b57e6e05705f6e5cef13028e77d7a30d
4
- data.tar.gz: e923fe60b61214229d3546868a82128607147fb462a7966552ebc67e5d1263e8
3
+ metadata.gz: e0b036d234a60e209cbc230d2c4e59ae7cded8f49f8639b63f3d0589610043fc
4
+ data.tar.gz: 736290686f770587e2a270921d34a2a8b78015c2e3539be5a476980318314ad3
5
5
  SHA512:
6
- metadata.gz: 2ab79a44f5d86fbb3fd17c56e3d876ce256f95f88508300d571ebd6a068973323082f7c1a32cf1edd44bbcec5351a073363c08d4950cae6e0510e54263cff448
7
- data.tar.gz: a02418a2e5db122bf0fcf3bce2d5547033e4c8e71b18f7a39006674e0a55cd46fb658986224c6f025c3b028e8bac48d19370c903abaa41e874456420ab2c0bf2
6
+ metadata.gz: afb5f59c5836aa78326f82adbcf05a3620a4bbce772e8f03a6b5e715550720eeaf511b267a9cbac5c800bec16edad0f7e6eba466d2bfbcd96746d8fc9f00efc2
7
+ data.tar.gz: 707e28800455819c2f2a1c1585f68a302d3d8e8e62ccc186838f37fc110345da8dcdd5310857ebe49e9f6ef218ae7122af1a4b9655e6356ace519c5ff42f17fd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v2.1.0, 23 June 2021
2
+
3
+ - Support Onfido API version 3.2
4
+
1
5
  ## v2.0.2, 10 June 2021
2
6
 
3
7
  - Add error coverage for errors RestClient:BadGateway
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.1 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.2 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
 
@@ -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.1/"
35
+ @unknown_api_url || "https://api.#{@region}.onfido.com/v3.2/"
36
36
  end
37
37
  end
38
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onfido
4
- VERSION = '2.0.2'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -34,7 +34,7 @@ describe Onfido::Applicant do
34
34
 
35
35
  it 'serializes the payload correctly' do
36
36
  WebMock.after_request do |request_signature, _response|
37
- if request_signature.uri.path == 'v3.1/applicants'
37
+ if request_signature.uri.path == 'v3.2/applicants'
38
38
  expect(Rack::Utils.parse_nested_query(request_signature.body))
39
39
  .to eq(params)
40
40
  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.1/'
29
+ expect(rest_client.url).to eq 'https://api.us.onfido.com/v3.2/'
30
30
  end
31
31
 
32
32
  it 'configures with timeouts' do
@@ -9,32 +9,32 @@ RSpec.shared_context 'fake onfido api' do
9
9
  end
10
10
 
11
11
  class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
12
- get '/v3.1/addresses/pick' do
12
+ get '/v3.2/addresses/pick' do
13
13
  json_response(200, 'addresses.json')
14
14
  end
15
15
 
16
- post '/v3.1/applicants' do
16
+ post '/v3.2/applicants' do
17
17
  json_response(201, 'applicant.json')
18
18
  end
19
19
 
20
- put '/v3.1/applicants/:id' do
20
+ put '/v3.2/applicants/:id' do
21
21
  json_response(200, 'applicant.json')
22
22
  end
23
23
 
24
- get '/v3.1/applicants/:id' do
24
+ get '/v3.2/applicants/:id' do
25
25
  json_response(200, 'applicant.json')
26
26
  end
27
27
 
28
- get '/v3.1/applicants' do
28
+ get '/v3.2/applicants' do
29
29
  response = json_response(200, 'applicants.json')
30
30
  { applicants: JSON.parse(response)['applicants'][pagination_range] }.to_json
31
31
  end
32
32
 
33
- delete '/v3.1/applicants/:id' do
33
+ delete '/v3.2/applicants/:id' do
34
34
  status 204
35
35
  end
36
36
 
37
- post '/v3.1/applicants/:id/restore' do
37
+ post '/v3.2/applicants/:id/restore' do
38
38
  if params['id'] == 'a2fb9c62-ab10-4898-a8ec-342c4b552ad5'
39
39
  json_response(422, 'not_scheduled_for_deletion_error.json')
40
40
  else
@@ -42,37 +42,37 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
42
42
  end
43
43
  end
44
44
 
45
- post '/v3.1/documents' do
45
+ post '/v3.2/documents' do
46
46
  json_response(201, 'document.json')
47
47
  end
48
48
 
49
- post '/v3.1/extractions' do
49
+ post '/v3.2/extractions' do
50
50
  json_response(201, 'extraction.json')
51
51
  end
52
52
 
53
- get '/v3.1/documents/:id' do
53
+ get '/v3.2/documents/:id' do
54
54
  json_response(200, 'document.json')
55
55
  end
56
56
 
57
- get '/v3.1/documents' do
57
+ get '/v3.2/documents' do
58
58
  json_response(200, 'documents.json')
59
59
  end
60
60
 
61
- get '/v3.1/documents/:id/download' do
61
+ get '/v3.2/documents/:id/download' do
62
62
  status 200
63
63
  content_type 'application/octet-stream'
64
64
  "\x01\x02\x03" # acts as binary file data
65
65
  end
66
66
 
67
- post '/v3.1/live_photos' do
67
+ post '/v3.2/live_photos' do
68
68
  json_response(201, 'live_photo.json')
69
69
  end
70
70
 
71
- get '/v3.1/live_photos/:id' do
71
+ get '/v3.2/live_photos/:id' do
72
72
  json_response(200, 'live_photo.json')
73
73
  end
74
74
 
75
- get '/v3.1/live_photos' do
75
+ get '/v3.2/live_photos' do
76
76
  if params['applicant_id'] == '1030303-123123-123123'
77
77
  json_response(200, 'live_photos.json')
78
78
  else
@@ -80,17 +80,17 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
80
80
  end
81
81
  end
82
82
 
83
- get '/v3.1/live_photos/:id/download' do
83
+ get '/v3.2/live_photos/:id/download' do
84
84
  status 200
85
85
  content_type 'image/jpeg'
86
86
  "\x01\x02\x03" # acts as binary file data
87
87
  end
88
88
 
89
- get '/v3.1/live_videos/:id' do
89
+ get '/v3.2/live_videos/:id' do
90
90
  json_response(200, 'live_video.json')
91
91
  end
92
92
 
93
- get '/v3.1/live_videos' do
93
+ get '/v3.2/live_videos' do
94
94
  if params['applicant_id'] == '1030303-123123-123123'
95
95
  json_response(200, 'live_videos.json')
96
96
  else
@@ -98,80 +98,80 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
98
98
  end
99
99
  end
100
100
 
101
- get '/v3.1/live_videos/:id/download' do
101
+ get '/v3.2/live_videos/:id/download' do
102
102
  status 200
103
103
  content_type 'video/quicktime'
104
104
  "\x01\x02\x03" # acts as binary file data
105
105
  end
106
106
 
107
- post '/v3.1/checks' do
107
+ post '/v3.2/checks' do
108
108
  params['applicant_id'].nil? ? status(422) : json_response(201, 'check.json')
109
109
  end
110
110
 
111
- get '/v3.1/checks/:id' do
111
+ get '/v3.2/checks/:id' do
112
112
  json_response(200, 'check.json')
113
113
  end
114
114
 
115
- get '/v3.1/checks' do
115
+ get '/v3.2/checks' do
116
116
  json_response(200, 'checks.json')
117
117
  end
118
118
 
119
- post '/v3.1/checks/:id/resume' do
119
+ post '/v3.2/checks/:id/resume' do
120
120
  status 204 # no_content
121
121
  end
122
122
 
123
- get '/v3.1/checks/:id/download' do
123
+ get '/v3.2/checks/:id/download' do
124
124
  status 200
125
125
  content_type 'application/pdf'
126
126
  "\x01\x02\x03" # acts as binary file data
127
127
  end
128
128
 
129
- get '/v3.1/reports' do
129
+ get '/v3.2/reports' do
130
130
  json_response(200, 'reports.json')
131
131
  end
132
132
 
133
- get '/v3.1/reports/:id' do
133
+ get '/v3.2/reports/:id' do
134
134
  json_response(200, 'report.json')
135
135
  end
136
136
 
137
- post '/v3.1/reports/:id/resume' do
137
+ post '/v3.2/reports/:id/resume' do
138
138
  status 204
139
139
  end
140
140
 
141
- post '/v3.1/reports/:id/cancel' do
141
+ post '/v3.2/reports/:id/cancel' do
142
142
  status 204
143
143
  end
144
144
 
145
- post '/v3.1/sdk_token' do
145
+ post '/v3.2/sdk_token' do
146
146
  json_response(201, 'sdk_token.json')
147
147
  end
148
148
 
149
- post '/v3.1/webhooks' do
149
+ post '/v3.2/webhooks' do
150
150
  json_response(201, 'webhook.json')
151
151
  end
152
152
 
153
- get '/v3.1/webhooks/:id' do
153
+ get '/v3.2/webhooks/:id' do
154
154
  json_response(200, 'webhook.json')
155
155
  end
156
156
 
157
- delete '/v3.1/webhooks/:id' do
157
+ delete '/v3.2/webhooks/:id' do
158
158
  content_type 'application/json; charset=utf-8'
159
159
  status 204
160
160
  end
161
161
 
162
- get '/v3.1/webhooks' do
162
+ get '/v3.2/webhooks' do
163
163
  json_response(200, 'webhooks.json')
164
164
  end
165
165
 
166
- get '/v3.1/4xx_response' do
166
+ get '/v3.2/4xx_response' do
167
167
  json_response(422, '4xx_response.json')
168
168
  end
169
169
 
170
- get '/v3.1/unexpected_error_format' do
170
+ get '/v3.2/unexpected_error_format' do
171
171
  json_response(400, 'unexpected_error_format.json')
172
172
  end
173
173
 
174
- get '/v3.1/unparseable_response' do
174
+ get '/v3.2/unparseable_response' do
175
175
  content_type :json
176
176
  status 504
177
177
  ''
@@ -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.1/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
10
+ "href":"/v3.2/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.1/checks/8546921-123123-123123",
4
+ "href": "/v3.2/checks/8546921-123123-123123",
5
5
  "applicant_provides_data": "false",
6
6
  "status": "pending",
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.1/checks/8546921-123123-123123",
6
+ "href": "/v3.2/checks/8546921-123123-123123",
7
7
  "applicant_provides_data": "false",
8
8
  "status": "pending",
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.1/documents/7568415-123123-123123",
4
+ "href": "/v3.2/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.1/documents/7568415-123123-123123",
6
+ "href": "/v3.2/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.1/documents/7568415-123123-123123",
15
+ "href": "/v3.2/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.1/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
- "download_href": "/v3.1/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
7
+ "href": "/v3.2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
+ "download_href": "/v3.2/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.1/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
- "download_href": "/v3.1/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
9
+ "href": "/v3.2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
+ "download_href": "/v3.2/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.1/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
- "download_href": "/v3.1/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
18
+ "href": "/v3.2/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
+ "download_href": "/v3.2/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.1/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
- "download_href" : "/v3.1/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
21
+ "href" : "/v3.2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
+ "download_href" : "/v3.2/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.1/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
19
+ "download_href": "/v3.2/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.1/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
23
+ "href": "/v3.2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
24
24
  "id": "c9701e9b-83aa-442f-995b-20320ee8fb01"
25
25
  }
26
26
  ]
@@ -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.1/reports/6951786-123123-422221",
7
+ "href": "/v3.2/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.1/reports/6951786-123123-422221",
9
+ "href": "/v3.2/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.1/reports/6951786-123123-316712",
19
+ "href": "/v3.2/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.1/webhooks/fcb73186-0733-4f6f-9c57-d9d5ef979443",
6
+ "href": "/v3.2/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.1/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
7
+ "href": "/v3.2/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.1/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
21
+ "href": "/v3.2/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
22
22
  "environments": [
23
23
  "live"
24
24
  ],
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.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onfido
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-10 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec