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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b50846731ee3d1258557cfbb22b8348d5328af3d2f8b0fba18548e37dc8963ea
4
- data.tar.gz: efef5ee6be4f2f839764d11e1fb00f23d24e554b1e1c5bbb33ec127fbe603534
3
+ metadata.gz: 11bed99ce3f8728f3f344682bf2bd77fc5a24c02ee28fb0ba498e62b338ec0ba
4
+ data.tar.gz: 101c8c0b12326edc85a44f6ffdfa6803e25b88c01392d99715dae7d188cb8579
5
5
  SHA512:
6
- metadata.gz: 7460854cfadcc65b683f1087130da5b23f46c3f1e9e4787b9aa5e82a5b8d394e3bea826fd085b70614d5d591e6ab78eff73365bd615ff8bc6e6e7f9f107d9680
7
- data.tar.gz: 567a9d3e0e751d042022ea2a41691485a1deedddaf91131f3c599e5390638f0e5155c855f4d58a233a69d0e2f3acd072e0f040d0ff022d0fe326a36034c29192
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.0'
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):
@@ -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.0"
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'] == 'binary'
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
@@ -11,5 +11,5 @@ Generator version: 7.11.0
11
11
  =end
12
12
 
13
13
  module Onfido
14
- VERSION = '5.1.0'
14
+ VERSION = '5.1.1'
15
15
  end
@@ -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
- it 'downloads a check' do
78
- file = onfido_api.download_check(check_id)
78
+ describe 'downloading a check' do
79
+ let(:file) { onfido_api.download_check(check_id) }
79
80
 
80
- expect(file.size).to be > 0
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
- it 'downloads a document' do
31
- file = onfido_api.download_document(document_id)
31
+ describe 'downloading a document' do
32
+ let(:file) { onfido_api.download_document(document_id) }
32
33
 
33
- expect(file.size).to be > 0
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
- it 'downloads an NFC face' do
45
- file = onfido_api.download_nfc_face(nfc_face_id)
45
+ describe 'downloading an NFC face' do
46
+ let(:file) { onfido_api.download_nfc_face(nfc_face_id) }
46
47
 
47
- expect(file.size).to be > 0
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
- it 'downloads id photo' do
39
- file = onfido_api.download_id_photo(id_photo_id)
39
+ describe 'downloading id photo' do
40
+ let(:file) { onfido_api.download_id_photo(id_photo_id) }
40
41
 
41
- expect(file.length).to be > 0
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
- it 'downloads live photo' do
31
- file = onfido_api.download_live_photo(live_photo_id)
31
+ describe 'downloading live photo' do
32
+ let(:file) { onfido_api.download_live_photo(live_photo_id) }
32
33
 
33
- expect(file.length).to be > 0
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
- it 'downloads live video' do
28
- file = onfido_api.download_live_video(live_video_id)
28
+ describe 'downloading live video' do
29
+ let(:file) { onfido_api.download_live_video(live_video_id) }
29
30
 
30
- expect(file.length).to be > 0
31
+ it_behaves_like "a valid MP4 file", 165093
31
32
  end
32
33
 
33
- it 'downloads live video frame' do
34
- file = onfido_api.download_live_video_frame(live_video_id)
34
+ describe 'downloading live video frame' do
35
+ let(:file) { onfido_api.download_live_video_frame(live_video_id) }
35
36
 
36
- expect(file.length).to be > 0
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
- it 'downloads motion capture' do
28
- file = onfido_api.download_motion_capture(motion_id)
28
+ describe 'downloading live video' do
29
+ let(:file) { onfido_api.download_motion_capture(motion_id) }
29
30
 
30
- expect(file.length).to be > 0
31
+ it_behaves_like "a valid MP4 file", 2720276
31
32
  end
32
33
 
33
- it 'downloads motion capture frame' do
34
- file = onfido_api.download_motion_capture_frame(motion_id)
34
+ describe 'downloading live video frame' do
35
+ let(:file) { onfido_api.download_motion_capture_frame(motion_id) }
35
36
 
36
- expect(file.length).to be > 0
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
- it 'downloads evidence file' do
51
- file = onfido_api.download_signed_evidence_file(workflow_run_id)
52
+ describe 'downloading evidence file' do
53
+ let(:file) { onfido_api.download_signed_evidence_file(workflow_run_id) }
52
54
 
53
- expect(file.size).to be > 0
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 > 0
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 > 0
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.0
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-14 00:00:00.000000000 Z
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