onfido 5.1.0 → 5.1.1
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 +2 -2
- data/lib/onfido/version.rb +1 -1
- data/spec/integrations/check_spec.rb +4 -3
- data/spec/integrations/document_spec.rb +7 -6
- data/spec/integrations/id_photo_spec.rb +4 -3
- data/spec/integrations/live_photo_spec.rb +4 -3
- data/spec/integrations/live_video_spec.rb +7 -6
- data/spec/integrations/motion_capture_spec.rb +7 -6
- data/spec/integrations/workflow_run_spec.rb +7 -5
- data/spec/shared_examples/file_examples.rb +44 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11bed99ce3f8728f3f344682bf2bd77fc5a24c02ee28fb0ba498e62b338ec0ba
|
4
|
+
data.tar.gz: 101c8c0b12326edc85a44f6ffdfa6803e25b88c01392d99715dae7d188cb8579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0106e4ca114ac27bf511ac9b77544ec999b2eaf464811f6ecbda7e40a3e36dd9c458b5a498873c1051eff7bda2781b3f328681874c357c576f5ec727631f1b98
|
7
|
+
data.tar.gz: 65fcb7074155ef64bbbf581fa53f342607d17375e169703231d4353f7f59ea3c00693c64480aa1bc74cbc71d4b9ba9e891551b7be694e909c71cf4b98ee66516
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.1.0 14th May 2025
|
4
|
+
|
5
|
+
- Release based on Onfido OpenAPI spec version [v5.1.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.1.0):
|
6
|
+
- CAT-1760: create get applicant consents endpoint
|
7
|
+
- Update Ruby library README template
|
8
|
+
- [CAT-1911] Fix document_with_driving_licence_information to be a list of objects
|
9
|
+
- [AF-1390] Fix: Device Intelligence Report Schema
|
10
|
+
- [CAT-1944] Add OAuth fields for Webhook authentication
|
11
|
+
- Fix storage of device_fingerprint_reuse breakdown and properties as float
|
12
|
+
- Add .markdownlint.json to templates
|
13
|
+
|
3
14
|
## v5.0.0 21st February 2025
|
4
15
|
|
5
16
|
- Release based on Onfido OpenAPI spec version [v5.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.0.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', '~> 5.1.
|
17
|
+
gem 'onfido', '~> 5.1.1'
|
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
@@ -35,7 +35,7 @@ module Onfido
|
|
35
35
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
36
36
|
def initialize(config = Configuration.default)
|
37
37
|
@config = config
|
38
|
-
@user_agent = "onfido-ruby/5.1.
|
38
|
+
@user_agent = "onfido-ruby/5.1.1"
|
39
39
|
@default_headers = {
|
40
40
|
'Content-Type' => 'application/json',
|
41
41
|
'User-Agent' => @user_agent
|
@@ -175,7 +175,7 @@ module Onfido
|
|
175
175
|
|
176
176
|
# reconstruct content
|
177
177
|
content = stream.join
|
178
|
-
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == '
|
178
|
+
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'base64'
|
179
179
|
content = content.force_encoding(encoding)
|
180
180
|
|
181
181
|
# return byte stream
|
data/lib/onfido/version.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_check'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::Check do
|
6
7
|
describe 'Checks' do
|
@@ -74,10 +75,10 @@ describe Onfido::Check do
|
|
74
75
|
onfido_api.resume_check(check_id)
|
75
76
|
end
|
76
77
|
|
77
|
-
|
78
|
-
file
|
78
|
+
describe 'downloading a check' do
|
79
|
+
let(:file) { onfido_api.download_check(check_id) }
|
79
80
|
|
80
|
-
|
81
|
+
it_behaves_like "a valid PDF file"
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_document'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::Document do
|
6
7
|
describe 'Documents' do
|
@@ -27,10 +28,10 @@ describe Onfido::Document do
|
|
27
28
|
expect(get_document.id).to eq document_id
|
28
29
|
end
|
29
30
|
|
30
|
-
|
31
|
-
file
|
31
|
+
describe 'downloading a document' do
|
32
|
+
let(:file) { onfido_api.download_document(document_id) }
|
32
33
|
|
33
|
-
|
34
|
+
it_behaves_like "a valid PNG file", 361771
|
34
35
|
end
|
35
36
|
|
36
37
|
it 'cannot download an inexistent document' do
|
@@ -41,10 +42,10 @@ describe Onfido::Document do
|
|
41
42
|
}
|
42
43
|
end
|
43
44
|
|
44
|
-
|
45
|
-
file
|
45
|
+
describe 'downloading an NFC face' do
|
46
|
+
let(:file) { onfido_api.download_nfc_face(nfc_face_id) }
|
46
47
|
|
47
|
-
|
48
|
+
it_behaves_like "a valid PNG file", 471345
|
48
49
|
end
|
49
50
|
|
50
51
|
it 'cannot download an inexistent NFC face' do
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_applicant'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::IdPhoto do
|
6
7
|
describe 'Id Photo' do
|
@@ -35,10 +36,10 @@ describe Onfido::IdPhoto do
|
|
35
36
|
expect(get_id_photo.id).to eq id_photo_id
|
36
37
|
end
|
37
38
|
|
38
|
-
|
39
|
-
file
|
39
|
+
describe 'downloading id photo' do
|
40
|
+
let(:file) { onfido_api.download_id_photo(id_photo_id) }
|
40
41
|
|
41
|
-
|
42
|
+
it_behaves_like "a valid PNG file", 395856
|
42
43
|
end
|
43
44
|
|
44
45
|
it 'raises an error with the correct status code when trying to download an inexistent id photo' do
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_live_photo'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::LivePhoto do
|
6
7
|
describe 'Live Photo' do
|
@@ -27,10 +28,10 @@ describe Onfido::LivePhoto do
|
|
27
28
|
expect(live_photo).to be_an_instance_of Onfido::LivePhoto
|
28
29
|
end
|
29
30
|
|
30
|
-
|
31
|
-
file
|
31
|
+
describe 'downloading live photo' do
|
32
|
+
let(:file) { onfido_api.download_live_photo(live_photo_id) }
|
32
33
|
|
33
|
-
|
34
|
+
it_behaves_like "a valid PNG file", 395856
|
34
35
|
end
|
35
36
|
|
36
37
|
it 'raises an error with the correct status code when trying to download an inexistent live photo' do
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_onfido'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::LiveVideo do
|
6
7
|
describe 'Live Video' do
|
@@ -24,16 +25,16 @@ describe Onfido::LiveVideo do
|
|
24
25
|
expect(get_live_video).to be_an_instance_of Onfido::LiveVideo
|
25
26
|
end
|
26
27
|
|
27
|
-
|
28
|
-
file
|
28
|
+
describe 'downloading live video' do
|
29
|
+
let(:file) { onfido_api.download_live_video(live_video_id) }
|
29
30
|
|
30
|
-
|
31
|
+
it_behaves_like "a valid MP4 file", 165093
|
31
32
|
end
|
32
33
|
|
33
|
-
|
34
|
-
file
|
34
|
+
describe 'downloading live video frame' do
|
35
|
+
let(:file) { onfido_api.download_live_video_frame(live_video_id) }
|
35
36
|
|
36
|
-
|
37
|
+
it_behaves_like "a valid JPEG file", 1692
|
37
38
|
end
|
38
39
|
|
39
40
|
it 'raises an error with the correct status code when trying to download an inexistent live video' do
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_onfido'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
4
5
|
|
5
6
|
describe Onfido::MotionCapture do
|
6
7
|
describe 'Motion Capture' do
|
@@ -24,16 +25,16 @@ describe Onfido::MotionCapture do
|
|
24
25
|
expect(get_motion_capture).to be_an_instance_of Onfido::MotionCapture
|
25
26
|
end
|
26
27
|
|
27
|
-
|
28
|
-
file
|
28
|
+
describe 'downloading live video' do
|
29
|
+
let(:file) { onfido_api.download_motion_capture(motion_id) }
|
29
30
|
|
30
|
-
|
31
|
+
it_behaves_like "a valid MP4 file", 2720276
|
31
32
|
end
|
32
33
|
|
33
|
-
|
34
|
-
file
|
34
|
+
describe 'downloading live video frame' do
|
35
|
+
let(:file) { onfido_api.download_motion_capture_frame(motion_id) }
|
35
36
|
|
36
|
-
|
37
|
+
it_behaves_like "a valid JPEG file", 75627
|
37
38
|
end
|
38
39
|
|
39
40
|
it 'raises an error with the correct status code when trying to download an inexistent motion capture' do
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../shared_contexts/with_workflow_run'
|
4
|
+
require_relative '../shared_examples/file_examples'
|
5
|
+
|
4
6
|
require 'zip'
|
5
7
|
|
6
8
|
describe Onfido::WorkflowRun do
|
@@ -47,10 +49,10 @@ describe Onfido::WorkflowRun do
|
|
47
49
|
expect(get_workflow_run.id).to eq workflow_run_id
|
48
50
|
end
|
49
51
|
|
50
|
-
|
51
|
-
file
|
52
|
+
describe 'downloading evidence file' do
|
53
|
+
let(:file) { onfido_api.download_signed_evidence_file(workflow_run_id) }
|
52
54
|
|
53
|
-
|
55
|
+
it_behaves_like "a valid PDF file", 497605
|
54
56
|
end
|
55
57
|
|
56
58
|
context 'with start -> approved workflow' do
|
@@ -78,7 +80,7 @@ describe Onfido::WorkflowRun do
|
|
78
80
|
onfido_api.find_timeline_file(workflow_run_id, timeline_file_id)
|
79
81
|
end
|
80
82
|
|
81
|
-
expect(file.size).to be >
|
83
|
+
expect(file.size).to be > 100000
|
82
84
|
end
|
83
85
|
|
84
86
|
it 'downloads an evidence folder' do
|
@@ -87,7 +89,7 @@ describe Onfido::WorkflowRun do
|
|
87
89
|
end
|
88
90
|
|
89
91
|
Zip::File.open(file.path) do |zip|
|
90
|
-
expect(zip.entries.size).to be >
|
92
|
+
expect(zip.entries.size).to be > 1
|
91
93
|
end
|
92
94
|
end
|
93
95
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.shared_examples_for "a valid file" do |expected_size|
|
4
|
+
it "is not nil and has a size greater than 0" do
|
5
|
+
expect(file).not_to be_nil
|
6
|
+
expect(file.size).to be > 0
|
7
|
+
end
|
8
|
+
|
9
|
+
it "has the expected file size" do
|
10
|
+
expect(file.size).to equal expected_size if expected_size
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
RSpec.shared_examples_for "a file with signature" do |signature, offset, length|
|
15
|
+
it "has a valid signature" do
|
16
|
+
signature_to_check = String.new(signature, encoding: 'BINARY')
|
17
|
+
|
18
|
+
File.open(file.path, 'rb') do |file_handler|
|
19
|
+
file_handler.rewind
|
20
|
+
content = file_handler.read(offset + length)
|
21
|
+
expect(content[offset, length]).to eq(signature_to_check)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
RSpec.shared_examples_for "a valid PNG file" do |expected_size|
|
27
|
+
include_examples "a valid file", expected_size
|
28
|
+
include_examples "a file with signature", "\x89PNG\r\n\x1A\n", 0, 8
|
29
|
+
end
|
30
|
+
|
31
|
+
RSpec.shared_examples_for "a valid PDF file" do |expected_size|
|
32
|
+
include_examples "a valid file", expected_size
|
33
|
+
include_examples "a file with signature", "%PDF-", 0, 5
|
34
|
+
end
|
35
|
+
|
36
|
+
RSpec.shared_examples_for "a valid JPEG file" do |expected_size|
|
37
|
+
include_examples "a valid file", expected_size
|
38
|
+
include_examples "a file with signature", "\xFF\xD8\xFF\xE0\x00\x10JF", 0, 8
|
39
|
+
end
|
40
|
+
|
41
|
+
RSpec.shared_examples_for "a valid MP4 file" do |expected_size|
|
42
|
+
include_examples "a valid file", expected_size
|
43
|
+
include_examples "a file with signature", "ftyp", 4, 4
|
44
|
+
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.1.
|
4
|
+
version: 5.1.1
|
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-05-
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -463,6 +463,7 @@ files:
|
|
463
463
|
- spec/shared_contexts/with_live_photo.rb
|
464
464
|
- spec/shared_contexts/with_onfido.rb
|
465
465
|
- spec/shared_contexts/with_workflow_run.rb
|
466
|
+
- spec/shared_examples/file_examples.rb
|
466
467
|
- spec/spec_helper.rb
|
467
468
|
- spec/studio_webhook_event_verifier_spec.rb
|
468
469
|
homepage: https://github.com/onfido/onfido-ruby
|
@@ -518,5 +519,6 @@ test_files:
|
|
518
519
|
- spec/shared_contexts/with_onfido.rb
|
519
520
|
- spec/shared_contexts/with_live_photo.rb
|
520
521
|
- spec/shared_contexts/with_document.rb
|
522
|
+
- spec/shared_examples/file_examples.rb
|
521
523
|
- spec/spec_helper.rb
|
522
524
|
- spec/studio_webhook_event_verifier_spec.rb
|