yoti_sandbox 1.2.1 → 1.3.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/lib/yoti_sandbox/doc_scan.rb +1 -0
- data/lib/yoti_sandbox/doc_scan/request/check/id_document_comparison_check.rb +56 -0
- data/lib/yoti_sandbox/doc_scan/request/check_reports.rb +27 -8
- data/yoti_sandbox.gemspec +15 -2
- metadata +3 -10
- data/.github/ISSUE_TEMPLATE.md +0 -17
- data/.github/dependabot.yml +0 -13
- data/.gitignore +0 -56
- data/CONTRIBUTING.md +0 -30
- data/Guardfile +0 -11
- data/Rakefile +0 -41
- data/rubocop.yml +0 -44
- data/yardstick.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dca617f8f85c6d5f3f8cab50bbbaed9d25d02400fe57d92fa79e96741910460
|
4
|
+
data.tar.gz: 5ff037daed4c3c10499c2fdb707359ee12fb8f498806f207842009a9012ec138
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd19939c2a54cb656244b367c75ab362cd931aaf533f324c3b5c309c8ed61a5fc44d310f49f1295ccea98f70aa392e4276ffa4f3edfc2776603d61324168ee59
|
7
|
+
data.tar.gz: 2702371dbc5dd6caf8ddfce5c7eaf06d110f217d314d2c402ece5d5d87b63430eb1a52ffb98427e47ead8eadd4984ae3b5fa04ede3845e3daf10fefaa6134362
|
@@ -9,6 +9,7 @@ require_relative 'doc_scan/request/document_filter'
|
|
9
9
|
require_relative 'doc_scan/request/check/check'
|
10
10
|
require_relative 'doc_scan/request/check/document_check'
|
11
11
|
require_relative 'doc_scan/request/check/document_authenticity_check'
|
12
|
+
require_relative 'doc_scan/request/check/id_document_comparison_check'
|
12
13
|
require_relative 'doc_scan/request/check/document_face_match_check'
|
13
14
|
require_relative 'doc_scan/request/check/document_text_data_check'
|
14
15
|
require_relative 'doc_scan/request/check/liveness_check'
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Yoti
|
4
|
+
module Sandbox
|
5
|
+
module DocScan
|
6
|
+
module Request
|
7
|
+
class IdDocumentComparisonCheck < Check
|
8
|
+
#
|
9
|
+
# @param [CheckResult] result
|
10
|
+
# @param [DocumentFilter] secondary_document_filter
|
11
|
+
#
|
12
|
+
def initialize(result, secondary_document_filter)
|
13
|
+
super(result)
|
14
|
+
|
15
|
+
Validation.assert_is_a(DocumentFilter, secondary_document_filter, 'secondary_document_filter', true)
|
16
|
+
@secondary_document_filter = secondary_document_filter
|
17
|
+
end
|
18
|
+
|
19
|
+
def as_json(*_args)
|
20
|
+
json = super
|
21
|
+
json[:secondary_document_filter] = @secondary_document_filter.as_json unless @secondary_document_filter.nil?
|
22
|
+
json
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# @return [IdDocumentComparisonCheckBuilder]
|
27
|
+
#
|
28
|
+
def self.builder
|
29
|
+
IdDocumentComparisonCheckBuilder.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class IdDocumentComparisonCheckBuilder < CheckBuilder
|
34
|
+
#
|
35
|
+
# @param [DocumentFilter] secondary_document_filter
|
36
|
+
#
|
37
|
+
# @return [self]
|
38
|
+
#
|
39
|
+
def with_secondary_document_filter(secondary_document_filter)
|
40
|
+
@secondary_document_filter = secondary_document_filter
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# @return [IdDocumentComparisonCheck]
|
46
|
+
#
|
47
|
+
def build
|
48
|
+
report = CheckReport.new(@recommendation, @breakdowns)
|
49
|
+
result = CheckResult.new(report)
|
50
|
+
IdDocumentComparisonCheck.new(result, @secondary_document_filter)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -11,13 +11,15 @@ module Yoti
|
|
11
11
|
# @param [Array<LivenessCheck>] liveness_checks
|
12
12
|
# @param [Array<DocumentFaceMatchCheck>] document_face_match_checks
|
13
13
|
# @param [Integer] async_report_delay
|
14
|
+
# @param [Array<IdDocumentComparisonCheck>] id_document_comparison_checks
|
14
15
|
#
|
15
16
|
def initialize(
|
16
17
|
document_text_data_checks,
|
17
18
|
document_authenticity_checks,
|
18
19
|
liveness_checks,
|
19
20
|
document_face_match_checks,
|
20
|
-
async_report_delay
|
21
|
+
async_report_delay,
|
22
|
+
id_document_comparison_checks = nil
|
21
23
|
)
|
22
24
|
Validation.assert_is_a(Array, document_text_data_checks, 'document_text_data_checks')
|
23
25
|
@document_text_data_checks = document_text_data_checks
|
@@ -33,6 +35,9 @@ module Yoti
|
|
33
35
|
|
34
36
|
Validation.assert_is_a(Integer, async_report_delay, 'async_report_delay', true)
|
35
37
|
@async_report_delay = async_report_delay
|
38
|
+
|
39
|
+
Validation.assert_is_a(Array, id_document_comparison_checks, 'id_document_comparison_checks', true)
|
40
|
+
@id_document_comparison_checks = id_document_comparison_checks
|
36
41
|
end
|
37
42
|
|
38
43
|
def self.builder
|
@@ -45,12 +50,13 @@ module Yoti
|
|
45
50
|
|
46
51
|
def as_json(*_args)
|
47
52
|
{
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
:
|
53
|
-
|
53
|
+
ID_DOCUMENT_TEXT_DATA_CHECK: @document_text_data_checks,
|
54
|
+
ID_DOCUMENT_AUTHENTICITY: @document_authenticity_checks,
|
55
|
+
ID_DOCUMENT_FACE_MATCH: @document_face_match_checks,
|
56
|
+
LIVENESS: @liveness_checks,
|
57
|
+
ID_DOCUMENT_COMPARISON: @id_document_comparison_checks,
|
58
|
+
async_report_delay: @async_report_delay
|
59
|
+
}.compact
|
54
60
|
end
|
55
61
|
end
|
56
62
|
|
@@ -60,6 +66,7 @@ module Yoti
|
|
60
66
|
@document_text_data_checks = []
|
61
67
|
@document_authenticity_checks = []
|
62
68
|
@document_face_match_checks = []
|
69
|
+
@id_document_comparison_checks = []
|
63
70
|
end
|
64
71
|
|
65
72
|
#
|
@@ -117,6 +124,17 @@ module Yoti
|
|
117
124
|
self
|
118
125
|
end
|
119
126
|
|
127
|
+
#
|
128
|
+
# @param [IdDocumentComparisonCheck] id_document_comparison_check
|
129
|
+
#
|
130
|
+
# @return [self]
|
131
|
+
#
|
132
|
+
def with_id_document_comparison_check(id_document_comparison_check)
|
133
|
+
Validation.assert_is_a(IdDocumentComparisonCheck, id_document_comparison_check, 'id_document_comparison_check')
|
134
|
+
@id_document_comparison_checks << id_document_comparison_check
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
120
138
|
#
|
121
139
|
# @return [CheckReports]
|
122
140
|
#
|
@@ -126,7 +144,8 @@ module Yoti
|
|
126
144
|
@document_authenticity_checks,
|
127
145
|
@liveness_checks,
|
128
146
|
@document_face_match_checks,
|
129
|
-
@async_report_delay
|
147
|
+
@async_report_delay,
|
148
|
+
@id_document_comparison_checks
|
130
149
|
)
|
131
150
|
end
|
132
151
|
end
|
data/yoti_sandbox.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'yoti_sandbox'
|
6
|
-
spec.version = '1.
|
6
|
+
spec.version = '1.3.0'
|
7
7
|
spec.authors = ['Yoti']
|
8
8
|
spec.email = ['websdk@yoti.com']
|
9
9
|
|
@@ -16,7 +16,20 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.homepage = 'https://github.com/getyoti/yoti-ruby-sdk-sandbox'
|
17
17
|
spec.license = 'MIT'
|
18
18
|
|
19
|
-
|
19
|
+
exclude_patterns = [
|
20
|
+
'^(test|spec|features|examples|docs|.github)/',
|
21
|
+
'^.gitignore$',
|
22
|
+
'^.pre-commit-config.yaml$',
|
23
|
+
'^sonar-project.properties$',
|
24
|
+
'^.dependabot/config.yml$',
|
25
|
+
'^.travis.yml$',
|
26
|
+
'^CONTRIBUTING.md$',
|
27
|
+
'^Guardfile$',
|
28
|
+
'^Rakefile$',
|
29
|
+
'^yardstick.yml$',
|
30
|
+
'^rubocop.yml$'
|
31
|
+
]
|
32
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/#{exclude_patterns.join('|')}/) }
|
20
33
|
spec.require_paths = ['lib']
|
21
34
|
|
22
35
|
spec.required_ruby_version = '>= 2.4'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yoti_sandbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yoti
|
@@ -131,15 +131,9 @@ executables: []
|
|
131
131
|
extensions: []
|
132
132
|
extra_rdoc_files: []
|
133
133
|
files:
|
134
|
-
- ".github/ISSUE_TEMPLATE.md"
|
135
|
-
- ".github/dependabot.yml"
|
136
|
-
- ".gitignore"
|
137
|
-
- CONTRIBUTING.md
|
138
134
|
- Gemfile
|
139
|
-
- Guardfile
|
140
135
|
- LICENSE
|
141
136
|
- README.md
|
142
|
-
- Rakefile
|
143
137
|
- lib/yoti_sandbox.rb
|
144
138
|
- lib/yoti_sandbox/doc_scan.rb
|
145
139
|
- lib/yoti_sandbox/doc_scan/client.rb
|
@@ -149,6 +143,7 @@ files:
|
|
149
143
|
- lib/yoti_sandbox/doc_scan/request/check/document_check.rb
|
150
144
|
- lib/yoti_sandbox/doc_scan/request/check/document_face_match_check.rb
|
151
145
|
- lib/yoti_sandbox/doc_scan/request/check/document_text_data_check.rb
|
146
|
+
- lib/yoti_sandbox/doc_scan/request/check/id_document_comparison_check.rb
|
152
147
|
- lib/yoti_sandbox/doc_scan/request/check/liveness_check.rb
|
153
148
|
- lib/yoti_sandbox/doc_scan/request/check/report/breakdown.rb
|
154
149
|
- lib/yoti_sandbox/doc_scan/request/check/report/detail.rb
|
@@ -168,8 +163,6 @@ files:
|
|
168
163
|
- lib/yoti_sandbox/profile/extra_data.rb
|
169
164
|
- lib/yoti_sandbox/profile/third_party.rb
|
170
165
|
- lib/yoti_sandbox/profile/token_request.rb
|
171
|
-
- rubocop.yml
|
172
|
-
- yardstick.yml
|
173
166
|
- yoti_sandbox.gemspec
|
174
167
|
homepage: https://github.com/getyoti/yoti-ruby-sdk-sandbox
|
175
168
|
licenses:
|
data/.github/ISSUE_TEMPLATE.md
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Custom issue template
|
3
|
-
about: " There's a better way to get help!"
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
#
|
11
|
-
# Wait ✋
|
12
|
-
#
|
13
|
-
# There's a better way to get help!
|
14
|
-
#
|
15
|
-
# Send your questions or issues to sdksupport@yoti.com
|
16
|
-
#
|
17
|
-
#
|
data/.github/dependabot.yml
DELETED
data/.gitignore
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
.env
|
15
|
-
|
16
|
-
# Ignore Byebug command history file.
|
17
|
-
.byebug_history
|
18
|
-
|
19
|
-
## Specific to RubyMotion:
|
20
|
-
.dat*
|
21
|
-
.repl_history
|
22
|
-
build/
|
23
|
-
*.bridgesupport
|
24
|
-
build-iPhoneOS/
|
25
|
-
build-iPhoneSimulator/
|
26
|
-
|
27
|
-
## Specific to RubyMotion (use of CocoaPods):
|
28
|
-
#
|
29
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
-
#
|
33
|
-
# vendor/Pods/
|
34
|
-
|
35
|
-
## Documentation cache and generated files:
|
36
|
-
/.yardoc/
|
37
|
-
/_yardoc/
|
38
|
-
/doc/
|
39
|
-
/rdoc/
|
40
|
-
|
41
|
-
## Environment normalization:
|
42
|
-
/.bundle/
|
43
|
-
/vendor/bundle
|
44
|
-
/lib/bundler/man/
|
45
|
-
|
46
|
-
# for a library or gem, you might want to ignore these files since the code is
|
47
|
-
# intended to run in multiple environments; otherwise, check them in:
|
48
|
-
Gemfile.lock
|
49
|
-
.ruby-version
|
50
|
-
.ruby-gemset
|
51
|
-
|
52
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
-
.rvmrc
|
54
|
-
|
55
|
-
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
-
# .rubocop-https?--*
|
data/CONTRIBUTING.md
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake spec` to run the tests. To install this gem onto your local machine, run `bundle exec rake install`.
|
4
|
-
|
5
|
-
You can use [Guard][] to automatically run the tests every time a file in the `lib` or `spec` folder changes.
|
6
|
-
|
7
|
-
Run Guard through Bundler with:
|
8
|
-
|
9
|
-
```shell
|
10
|
-
bundle exec guard
|
11
|
-
```
|
12
|
-
|
13
|
-
[Guard]: https://github.com/guard/guard
|
14
|
-
|
15
|
-
## Code coverage
|
16
|
-
|
17
|
-
The 100% code coverage requirement must be met before submitting new code.
|
18
|
-
This can be checked by opening the generated [SimpleCov][] files:
|
19
|
-
|
20
|
-
```shell
|
21
|
-
open coverage/index.html
|
22
|
-
```
|
23
|
-
|
24
|
-
## Style guide
|
25
|
-
|
26
|
-
The Ruby style guide is configured in the [rubocop.yml](rubocop.yml) file and can be checked by running:
|
27
|
-
|
28
|
-
```shell
|
29
|
-
bundle exec rake rubocop
|
30
|
-
```
|
data/Guardfile
DELETED
data/Rakefile
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
################################
|
6
|
-
# Tests #
|
7
|
-
################################
|
8
|
-
|
9
|
-
RSpec::Core::RakeTask.new
|
10
|
-
task test: :spec
|
11
|
-
|
12
|
-
################################
|
13
|
-
# Rubocop #
|
14
|
-
################################
|
15
|
-
|
16
|
-
require 'rubocop/rake_task'
|
17
|
-
RuboCop::RakeTask.new(:rubocop) do |t|
|
18
|
-
t.options = ['--config', 'rubocop.yml']
|
19
|
-
end
|
20
|
-
|
21
|
-
################################
|
22
|
-
# Documentation #
|
23
|
-
################################
|
24
|
-
|
25
|
-
require 'yard'
|
26
|
-
YARD::Rake::YardocTask.new do |t|
|
27
|
-
t.stats_options = ['--list-undoc']
|
28
|
-
end
|
29
|
-
|
30
|
-
yardstick_options = YAML.load_file('yardstick.yml')
|
31
|
-
|
32
|
-
require 'yardstick/rake/measurement'
|
33
|
-
Yardstick::Rake::Measurement.new(:measurement, yardstick_options) do |measurement|
|
34
|
-
measurement.output = 'measurement/report.txt'
|
35
|
-
end
|
36
|
-
|
37
|
-
################################
|
38
|
-
# Defaults #
|
39
|
-
################################
|
40
|
-
|
41
|
-
task default: %i[spec rubocop]
|
data/rubocop.yml
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
DisplayCopNames: true
|
3
|
-
DisplayStyleGuide: true
|
4
|
-
TargetRubyVersion: 2.4
|
5
|
-
|
6
|
-
Metrics/AbcSize:
|
7
|
-
Enabled: false
|
8
|
-
Max: 23
|
9
|
-
|
10
|
-
Metrics/BlockLength:
|
11
|
-
Exclude:
|
12
|
-
- spec/**/**/*.rb
|
13
|
-
- examples/**/*.rb
|
14
|
-
|
15
|
-
Metrics/ClassLength:
|
16
|
-
Enabled: false
|
17
|
-
Max: 115
|
18
|
-
|
19
|
-
Metrics/ModuleLength:
|
20
|
-
Exclude:
|
21
|
-
- examples/doc_scan/**/*.rb
|
22
|
-
|
23
|
-
Metrics/CyclomaticComplexity:
|
24
|
-
Max: 9
|
25
|
-
|
26
|
-
Metrics/MethodLength:
|
27
|
-
Enabled: false
|
28
|
-
CountComments: false
|
29
|
-
Max: 19
|
30
|
-
|
31
|
-
Style/Documentation:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
Style/FrozenStringLiteralComment:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Style/NumericLiterals:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Style/MutableConstant:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
Layout/LineLength:
|
44
|
-
Enabled: false
|