yoti 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE.md +17 -0
  3. data/CONTRIBUTING.md +0 -29
  4. data/README.md +4 -0
  5. data/Rakefile +7 -10
  6. data/lib/yoti.rb +50 -1
  7. data/lib/yoti/activity_details.rb +5 -1
  8. data/lib/yoti/client.rb +13 -4
  9. data/lib/yoti/configuration.rb +7 -2
  10. data/lib/yoti/data_type/age_verification.rb +1 -1
  11. data/lib/yoti/data_type/base_profile.rb +1 -1
  12. data/lib/yoti/data_type/document_details.rb +5 -13
  13. data/lib/yoti/data_type/image.rb +4 -12
  14. data/lib/yoti/data_type/image_jpeg.rb +2 -0
  15. data/lib/yoti/data_type/image_png.rb +2 -0
  16. data/lib/yoti/data_type/media.rb +19 -0
  17. data/lib/yoti/doc_scan/client.rb +163 -0
  18. data/lib/yoti/doc_scan/constants.rb +28 -0
  19. data/lib/yoti/doc_scan/session/create/create_session_result.rb +50 -0
  20. data/lib/yoti/doc_scan/session/create/document_filter.rb +31 -0
  21. data/lib/yoti/doc_scan/session/create/document_restrictions_filter.rb +140 -0
  22. data/lib/yoti/doc_scan/session/create/notification_config.rb +142 -0
  23. data/lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb +150 -0
  24. data/lib/yoti/doc_scan/session/create/requested_check.rb +39 -0
  25. data/lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb +53 -0
  26. data/lib/yoti/doc_scan/session/create/requested_face_match_check.rb +95 -0
  27. data/lib/yoti/doc_scan/session/create/requested_liveness_check.rb +108 -0
  28. data/lib/yoti/doc_scan/session/create/requested_task.rb +39 -0
  29. data/lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb +94 -0
  30. data/lib/yoti/doc_scan/session/create/required_document.rb +31 -0
  31. data/lib/yoti/doc_scan/session/create/required_id_document.rb +53 -0
  32. data/lib/yoti/doc_scan/session/create/sdk_config.rb +221 -0
  33. data/lib/yoti/doc_scan/session/create/session_specification.rb +203 -0
  34. data/lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb +12 -0
  35. data/lib/yoti/doc_scan/session/retrieve/breakdown_response.rb +38 -0
  36. data/lib/yoti/doc_scan/session/retrieve/check_response.rb +63 -0
  37. data/lib/yoti/doc_scan/session/retrieve/details_response.rb +28 -0
  38. data/lib/yoti/doc_scan/session/retrieve/document_fields_response.rb +21 -0
  39. data/lib/yoti/doc_scan/session/retrieve/face_map_response.rb +21 -0
  40. data/lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb +12 -0
  41. data/lib/yoti/doc_scan/session/retrieve/frame_response.rb +21 -0
  42. data/lib/yoti/doc_scan/session/retrieve/generated_check_response.rb +28 -0
  43. data/lib/yoti/doc_scan/session/retrieve/generated_media.rb +28 -0
  44. data/lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb +12 -0
  45. data/lib/yoti/doc_scan/session/retrieve/get_session_result.rb +113 -0
  46. data/lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb +52 -0
  47. data/lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb +12 -0
  48. data/lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb +24 -0
  49. data/lib/yoti/doc_scan/session/retrieve/media_response.rb +38 -0
  50. data/lib/yoti/doc_scan/session/retrieve/page_response.rb +27 -0
  51. data/lib/yoti/doc_scan/session/retrieve/recommendation_response.rb +34 -0
  52. data/lib/yoti/doc_scan/session/retrieve/report_response.rb +31 -0
  53. data/lib/yoti/doc_scan/session/retrieve/resource_container.rb +50 -0
  54. data/lib/yoti/doc_scan/session/retrieve/resource_response.rb +39 -0
  55. data/lib/yoti/doc_scan/session/retrieve/task_response.rb +87 -0
  56. data/lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb +12 -0
  57. data/lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb +18 -0
  58. data/lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb +33 -0
  59. data/lib/yoti/doc_scan/support/supported_documents.rb +60 -0
  60. data/lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb +73 -12
  61. data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +17 -17
  62. data/lib/yoti/dynamic_share_service/share_url.rb +28 -33
  63. data/lib/yoti/errors.rb +17 -2
  64. data/lib/yoti/http/aml_check_request.rb +12 -6
  65. data/lib/yoti/http/payloads/aml_address.rb +4 -0
  66. data/lib/yoti/http/payloads/aml_profile.rb +7 -1
  67. data/lib/yoti/http/profile_request.rb +11 -6
  68. data/lib/yoti/http/request.rb +220 -18
  69. data/lib/yoti/http/signed_request.rb +13 -4
  70. data/lib/yoti/protobuf/main.rb +16 -6
  71. data/lib/yoti/share/attribute_issuance_details.rb +1 -1
  72. data/lib/yoti/ssl.rb +3 -2
  73. data/lib/yoti/util/anchor_processor.rb +1 -1
  74. data/lib/yoti/util/validation.rb +41 -0
  75. data/lib/yoti/version.rb +1 -1
  76. data/rubocop.yml +9 -1
  77. data/yoti.gemspec +2 -5
  78. metadata +51 -60
  79. data/lib/yoti/sandbox.rb +0 -5
  80. data/lib/yoti/sandbox/anchor.rb +0 -49
  81. data/lib/yoti/sandbox/attribute.rb +0 -52
  82. data/lib/yoti/sandbox/profile.rb +0 -171
  83. data/lib/yoti/sandbox/sandbox.rb +0 -105
  84. data/lib/yoti/sandbox/sandbox_client.rb +0 -45
@@ -3,6 +3,11 @@ require 'base64'
3
3
  module Yoti
4
4
  # Converts a basic Net::HTTP request into a Yoti Signed Request
5
5
  class SignedRequest
6
+ #
7
+ # @param [Net::HTTPRequest] unsigned_request
8
+ # @param [String] path
9
+ # @param [#to_json,String] payload
10
+ #
6
11
  def initialize(unsigned_request, path, payload = {})
7
12
  @http_req = unsigned_request
8
13
  @path = path
@@ -10,6 +15,9 @@ module Yoti
10
15
  @auth_key = Yoti::SSL.auth_key_from_pem
11
16
  end
12
17
 
18
+ #
19
+ # @return [Net::HTTPRequest]
20
+ #
13
21
  def sign
14
22
  @http_req['X-Yoti-Auth-Digest'] = message_signature
15
23
  @http_req['X-Yoti-SDK'] = Yoti.configuration.sdk_identifier
@@ -20,18 +28,19 @@ module Yoti
20
28
  private
21
29
 
22
30
  def message_signature
23
- @message_signature ||= Yoti::SSL.get_secure_signature("#{http_method}&#{@path}#{payload_string}")
31
+ @message_signature ||= Yoti::SSL.get_secure_signature("#{http_method}&#{@path}#{base64_payload}")
24
32
  end
25
33
 
26
34
  def http_method
27
35
  @http_req.method
28
36
  end
29
37
 
30
- # Create the base64 encoded request body
31
- def payload_string
38
+ def base64_payload
32
39
  return '' unless @payload
33
40
 
34
- '&' + Base64.strict_encode64(@payload.to_json)
41
+ payload_string = @payload.is_a?(String) ? @payload : @payload.to_json
42
+
43
+ '&' + Base64.strict_encode64(payload_string)
35
44
  end
36
45
  end
37
46
  end
@@ -44,9 +44,9 @@ module Yoti
44
44
  end
45
45
 
46
46
  def extra_data(receipt)
47
- return nil unless valid_receipt?(receipt)
47
+ return nil if receipt['extra_data_content'].nil? || receipt['extra_data_content'] == ''
48
48
 
49
- decipher_profile(receipt['extra_data'], receipt['wrapped_receipt_key']) if receipt['extra_data']
49
+ decipher_extra_data(receipt['extra_data_content'], receipt['wrapped_receipt_key'])
50
50
  end
51
51
 
52
52
  def attribute_list(data)
@@ -94,7 +94,7 @@ module Yoti
94
94
  proto_multi_value = Yoti::Protobuf::Attrpubapi::MultiValue.decode(value)
95
95
  items = []
96
96
  proto_multi_value.values.each do |item|
97
- items.append value_based_on_content_type(item.data, item.content_type)
97
+ items << value_based_on_content_type(item.data, item.content_type)
98
98
  end
99
99
  MultiValue.new(items)
100
100
  end
@@ -111,11 +111,21 @@ module Yoti
111
111
  end
112
112
 
113
113
  def decipher_profile(profile_content, wrapped_key)
114
- encrypted_data = decode_profile(profile_content)
115
- unwrapped_key = Yoti::SSL.decrypt_token(wrapped_key)
116
- decrypted_data = Yoti::SSL.decipher(unwrapped_key, encrypted_data.iv, encrypted_data.cipher_text)
114
+ decrypted_data = decipher_data(profile_content, wrapped_key)
117
115
  Protobuf.attribute_list(decrypted_data)
118
116
  end
117
+
118
+ def decipher_extra_data(extra_data_content, wrapped_key)
119
+ decrypted_data = decipher_data(extra_data_content, wrapped_key)
120
+ proto = Yoti::Protobuf::Sharepubapi::ExtraData.decode(decrypted_data)
121
+ Share::ExtraData.new(proto)
122
+ end
123
+
124
+ def decipher_data(encrypted_content, wrapped_key)
125
+ encrypted_data = decode_profile(encrypted_content)
126
+ unwrapped_key = Yoti::SSL.decrypt_token(wrapped_key)
127
+ Yoti::SSL.decipher(unwrapped_key, encrypted_data.iv, encrypted_data.cipher_text)
128
+ end
119
129
  end
120
130
  end
121
131
  end
@@ -28,7 +28,7 @@ module Yoti
28
28
  # @param [Yoti::Protobuf::Sharepubapi::ThirdPartyAttribute] data_entry
29
29
  #
30
30
  def initialize(data_entry)
31
- @token = Base64.encode64(data_entry.issuance_token)
31
+ @token = Base64.strict_encode64(data_entry.issuance_token)
32
32
  begin
33
33
  @expiry_date = DateTime.parse(data_entry.issuing_attributes.expiry_date)
34
34
  rescue ArgumentError
@@ -32,7 +32,7 @@ module Yoti
32
32
  end
33
33
 
34
34
  # Extracts the public key from pem key, converts it to a DER base 64 encoded value
35
- # @return [String] base 64 encoded anthentication key
35
+ # @return [String] base 64 encoded authentication key
36
36
  def auth_key_from_pem
37
37
  public_key = private_key.public_key
38
38
  Base64.strict_encode64(public_key.to_der)
@@ -48,7 +48,7 @@ module Yoti
48
48
 
49
49
  # Uses the decrypted receipt key and the current user's iv to decode the text
50
50
  # @param key [String] base 64 decoded key
51
- # @param iv [String] base 64 decoded iv
51
+ # @param user_iv [String] base 64 decoded iv
52
52
  # @param text [String] base 64 decoded cyphered text
53
53
  # @return [String] base 64 decoded deciphered text
54
54
  def decipher(key, user_iv, text)
@@ -60,6 +60,7 @@ module Yoti
60
60
  end
61
61
 
62
62
  # Reset and reload the Private Key used for SSL functions
63
+ # @deprecated 2.0.0
63
64
  def reload!
64
65
  @private_key = nil
65
66
  @pem = nil
@@ -7,7 +7,7 @@ module Yoti
7
7
  #
8
8
  class AnchorProcessor
9
9
  #
10
- # @param [Array<Yoti::Protobuf::Attrpubapi::Anchor>]
10
+ # @param [Array<Yoti::Protobuf::Attrpubapi::Anchor>] anchors_list
11
11
  #
12
12
  def initialize(anchors_list)
13
13
  @anchors_list = anchors_list
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Yoti
4
+ class Validation
5
+ #
6
+ # @param value
7
+ # @param [String] name
8
+ #
9
+ def self.assert_not_nil(value, name)
10
+ return unless value.nil?
11
+
12
+ raise(ArgumentError, "#{name} must not be nil")
13
+ end
14
+
15
+ #
16
+ # @param [Class] type
17
+ # @param value
18
+ # @param [String] name
19
+ # @param [Boolean] nilable
20
+ #
21
+ def self.assert_is_a(type, value, name, nilable = false)
22
+ return if nilable && value.nil?
23
+ return if value.is_a?(type)
24
+
25
+ raise(ArgumentError, "#{name} must be a #{type.name}")
26
+ end
27
+
28
+ #
29
+ # @param [Symbol] method
30
+ # @param value
31
+ # @param [String] name
32
+ #
33
+ def self.assert_respond_to(method, value, name)
34
+ assert_not_nil(value, name)
35
+
36
+ return if value.respond_to?(method)
37
+
38
+ raise(ArgumentError, "#{name} must respond to #{method}")
39
+ end
40
+ end
41
+ end
@@ -1,4 +1,4 @@
1
1
  module Yoti
2
2
  # @return [String] the gem's current version
3
- VERSION = '1.6.0'.freeze
3
+ VERSION = '1.7.0'.freeze
4
4
  end
@@ -4,6 +4,8 @@ AllCops:
4
4
  TargetRubyVersion: 2.4
5
5
  Exclude:
6
6
  - 'examples/rails/config/**/*'
7
+ - 'examples/doc_scan/config/**/*'
8
+ - 'examples/doc_scan/bin/**/*'
7
9
  - 'lib/yoti/protobuf/attrpubapi/*'
8
10
  - 'lib/yoti/protobuf/compubapi/*'
9
11
  - 'lib/yoti/protobuf/sharepubapi/*'
@@ -26,7 +28,7 @@ Metrics/ClassLength:
26
28
  Enabled: false
27
29
  Max: 115
28
30
 
29
- Metrics/LineLength:
31
+ Layout/LineLength:
30
32
  Enabled: false
31
33
 
32
34
  Metrics/MethodLength:
@@ -55,3 +57,9 @@ Naming/MethodName:
55
57
  Naming/PredicateName:
56
58
  Exclude:
57
59
  - lib/yoti/util/age_processor.rb
60
+
61
+ Metrics/ParameterLists:
62
+ Exclude:
63
+ - lib/yoti/doc_scan/session/create/sdk_config.rb
64
+ - lib/yoti/doc_scan/session/create/session_specification.rb
65
+ - spec/yoti/doc_scan/client_spec.rb
@@ -23,17 +23,14 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.required_ruby_version = '>= 2.4'
25
25
 
26
- spec.add_dependency 'activesupport', '~> 5.0' # Pin activesupport library to 5.x for Ruby 2.4 support
27
- spec.add_dependency 'google-protobuf', '~> 3.7', '>= 3.7.0'
28
- spec.add_dependency 'protobuf', '~> 3.6'
26
+ spec.add_dependency 'google-protobuf', '~> 3.7'
29
27
 
30
28
  spec.add_development_dependency 'bundler', '~> 2.0'
31
- spec.add_development_dependency 'coveralls', '~> 0.8'
32
29
  spec.add_development_dependency 'dotenv', '~> 2.2'
33
30
  spec.add_development_dependency 'generator_spec', '~> 0.9'
34
31
  spec.add_development_dependency 'rake', '~> 12.0'
35
32
  spec.add_development_dependency 'rspec', '~> 3.5'
36
- spec.add_development_dependency 'simplecov', '~> 0.13'
33
+ spec.add_development_dependency 'simplecov', '~> 0.17.1'
37
34
  spec.add_development_dependency 'webmock', '~> 3.3'
38
35
  spec.add_development_dependency 'yard', '~> 0.9'
39
36
  spec.add_development_dependency 'yardstick', '~> 0.9'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Zaremba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: google-protobuf
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -31,9 +17,6 @@ dependencies:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
19
  version: '3.7'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 3.7.0
37
20
  type: :runtime
38
21
  prerelease: false
39
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -41,23 +24,6 @@ dependencies:
41
24
  - - "~>"
42
25
  - !ruby/object:Gem::Version
43
26
  version: '3.7'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 3.7.0
47
- - !ruby/object:Gem::Dependency
48
- name: protobuf
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '3.6'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '3.6'
61
27
  - !ruby/object:Gem::Dependency
62
28
  name: bundler
63
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,20 +38,6 @@ dependencies:
72
38
  - - "~>"
73
39
  - !ruby/object:Gem::Version
74
40
  version: '2.0'
75
- - !ruby/object:Gem::Dependency
76
- name: coveralls
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '0.8'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '0.8'
89
41
  - !ruby/object:Gem::Dependency
90
42
  name: dotenv
91
43
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +100,14 @@ dependencies:
148
100
  requirements:
149
101
  - - "~>"
150
102
  - !ruby/object:Gem::Version
151
- version: '0.13'
103
+ version: 0.17.1
152
104
  type: :development
153
105
  prerelease: false
154
106
  version_requirements: !ruby/object:Gem::Requirement
155
107
  requirements:
156
108
  - - "~>"
157
109
  - !ruby/object:Gem::Version
158
- version: '0.13'
110
+ version: 0.17.1
159
111
  - !ruby/object:Gem::Dependency
160
112
  name: webmock
161
113
  requirement: !ruby/object:Gem::Requirement
@@ -208,6 +160,7 @@ executables: []
208
160
  extensions: []
209
161
  extra_rdoc_files: []
210
162
  files:
163
+ - ".github/ISSUE_TEMPLATE.md"
211
164
  - ".gitignore"
212
165
  - CONTRIBUTING.md
213
166
  - Gemfile
@@ -230,9 +183,53 @@ files:
230
183
  - lib/yoti/data_type/image.rb
231
184
  - lib/yoti/data_type/image_jpeg.rb
232
185
  - lib/yoti/data_type/image_png.rb
186
+ - lib/yoti/data_type/media.rb
233
187
  - lib/yoti/data_type/multi_value.rb
234
188
  - lib/yoti/data_type/profile.rb
235
189
  - lib/yoti/data_type/signed_time_stamp.rb
190
+ - lib/yoti/doc_scan/client.rb
191
+ - lib/yoti/doc_scan/constants.rb
192
+ - lib/yoti/doc_scan/session/create/create_session_result.rb
193
+ - lib/yoti/doc_scan/session/create/document_filter.rb
194
+ - lib/yoti/doc_scan/session/create/document_restrictions_filter.rb
195
+ - lib/yoti/doc_scan/session/create/notification_config.rb
196
+ - lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb
197
+ - lib/yoti/doc_scan/session/create/requested_check.rb
198
+ - lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb
199
+ - lib/yoti/doc_scan/session/create/requested_face_match_check.rb
200
+ - lib/yoti/doc_scan/session/create/requested_liveness_check.rb
201
+ - lib/yoti/doc_scan/session/create/requested_task.rb
202
+ - lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb
203
+ - lib/yoti/doc_scan/session/create/required_document.rb
204
+ - lib/yoti/doc_scan/session/create/required_id_document.rb
205
+ - lib/yoti/doc_scan/session/create/sdk_config.rb
206
+ - lib/yoti/doc_scan/session/create/session_specification.rb
207
+ - lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb
208
+ - lib/yoti/doc_scan/session/retrieve/breakdown_response.rb
209
+ - lib/yoti/doc_scan/session/retrieve/check_response.rb
210
+ - lib/yoti/doc_scan/session/retrieve/details_response.rb
211
+ - lib/yoti/doc_scan/session/retrieve/document_fields_response.rb
212
+ - lib/yoti/doc_scan/session/retrieve/face_map_response.rb
213
+ - lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb
214
+ - lib/yoti/doc_scan/session/retrieve/frame_response.rb
215
+ - lib/yoti/doc_scan/session/retrieve/generated_check_response.rb
216
+ - lib/yoti/doc_scan/session/retrieve/generated_media.rb
217
+ - lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb
218
+ - lib/yoti/doc_scan/session/retrieve/get_session_result.rb
219
+ - lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb
220
+ - lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb
221
+ - lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb
222
+ - lib/yoti/doc_scan/session/retrieve/media_response.rb
223
+ - lib/yoti/doc_scan/session/retrieve/page_response.rb
224
+ - lib/yoti/doc_scan/session/retrieve/recommendation_response.rb
225
+ - lib/yoti/doc_scan/session/retrieve/report_response.rb
226
+ - lib/yoti/doc_scan/session/retrieve/resource_container.rb
227
+ - lib/yoti/doc_scan/session/retrieve/resource_response.rb
228
+ - lib/yoti/doc_scan/session/retrieve/task_response.rb
229
+ - lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb
230
+ - lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb
231
+ - lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb
232
+ - lib/yoti/doc_scan/support/supported_documents.rb
236
233
  - lib/yoti/dynamic_share_service/dynamic_scenario.rb
237
234
  - lib/yoti/dynamic_share_service/extension/extension.rb
238
235
  - lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb
@@ -261,18 +258,13 @@ files:
261
258
  - lib/yoti/protobuf/sharepubapi/ExtraData_pb.rb
262
259
  - lib/yoti/protobuf/sharepubapi/IssuingAttributes_pb.rb
263
260
  - lib/yoti/protobuf/sharepubapi/ThirdPartyAttribute_pb.rb
264
- - lib/yoti/sandbox.rb
265
- - lib/yoti/sandbox/anchor.rb
266
- - lib/yoti/sandbox/attribute.rb
267
- - lib/yoti/sandbox/profile.rb
268
- - lib/yoti/sandbox/sandbox.rb
269
- - lib/yoti/sandbox/sandbox_client.rb
270
261
  - lib/yoti/share/attribute_issuance_details.rb
271
262
  - lib/yoti/share/extra_data.rb
272
263
  - lib/yoti/ssl.rb
273
264
  - lib/yoti/util/age_processor.rb
274
265
  - lib/yoti/util/anchor_processor.rb
275
266
  - lib/yoti/util/log.rb
267
+ - lib/yoti/util/validation.rb
276
268
  - lib/yoti/version.rb
277
269
  - login_flow.png
278
270
  - rubocop.yml
@@ -297,8 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
289
  - !ruby/object:Gem::Version
298
290
  version: '0'
299
291
  requirements: []
300
- rubyforge_project:
301
- rubygems_version: 2.6.14.4
292
+ rubygems_version: 3.0.6
302
293
  signing_key:
303
294
  specification_version: 4
304
295
  summary: Yoti Ruby SDK for back-end integration.
@@ -1,5 +0,0 @@
1
- require_relative 'sandbox/anchor'
2
- require_relative 'sandbox/attribute'
3
- require_relative 'sandbox/profile'
4
- require_relative 'sandbox/sandbox_client'
5
- require_relative 'sandbox/sandbox'
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sandbox
4
- # Anchor describes an anchor on a Sandbox Attribute
5
- class Anchor
6
- attr_reader :type
7
- attr_reader :value
8
- attr_reader :sub_type
9
- attr_reader :timestamp
10
-
11
- def initialize(type:, value:, sub_type: '', timestamp: Time.now)
12
- @type = type
13
- @value = value
14
- @sub_type = sub_type
15
- @timestamp = timestamp
16
- end
17
-
18
- def as_json(*_args)
19
- {
20
- type: @type,
21
- value: @value,
22
- sub_type: @sub_type,
23
- timestamp: @timestamp.to_i
24
- }
25
- end
26
-
27
- def to_json(*args)
28
- as_json.to_json(*args)
29
- end
30
-
31
- def self.source(value, sub_type: '', timestamp: Time.now)
32
- Anchor.new(
33
- type: 'SOURCE',
34
- value: value,
35
- sub_type: sub_type,
36
- timestamp: timestamp
37
- )
38
- end
39
-
40
- def self.verifier(value, sub_type: '', timestamp: Time.now)
41
- Anchor.new(
42
- type: 'VERIFIER',
43
- value: value,
44
- sub_type: sub_type,
45
- timestamp: timestamp
46
- )
47
- end
48
- end
49
- end