yoti 1.5.0 → 1.6.4

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +17 -0
  3. data/CONTRIBUTING.md +0 -29
  4. data/Gemfile +0 -2
  5. data/README.md +1 -1
  6. data/Rakefile +16 -3
  7. data/lib/yoti.rb +16 -0
  8. data/lib/yoti/activity_details.rb +21 -2
  9. data/lib/yoti/client.rb +2 -1
  10. data/lib/yoti/data_type/age_verification.rb +54 -0
  11. data/lib/yoti/data_type/attribute.rb +3 -0
  12. data/lib/yoti/data_type/base_profile.rb +13 -0
  13. data/lib/yoti/data_type/document_details.rb +88 -0
  14. data/lib/yoti/data_type/profile.rb +76 -0
  15. data/lib/yoti/dynamic_share_service/dynamic_scenario.rb +67 -0
  16. data/lib/yoti/dynamic_share_service/extension/extension.rb +45 -0
  17. data/lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb +88 -0
  18. data/lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb +119 -0
  19. data/lib/yoti/dynamic_share_service/extension/transactional_flow_extension.rb +47 -0
  20. data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +184 -0
  21. data/lib/yoti/dynamic_share_service/policy/source_constraint.rb +88 -0
  22. data/lib/yoti/dynamic_share_service/policy/wanted_anchor.rb +53 -0
  23. data/lib/yoti/dynamic_share_service/policy/wanted_attribute.rb +85 -0
  24. data/lib/yoti/dynamic_share_service/share_url.rb +82 -0
  25. data/lib/yoti/http/profile_request.rb +1 -0
  26. data/lib/yoti/http/request.rb +15 -0
  27. data/lib/yoti/http/signed_request.rb +0 -3
  28. data/lib/yoti/protobuf/main.rb +25 -4
  29. data/lib/yoti/protobuf/sharepubapi/DataEntry_pb.rb +29 -0
  30. data/lib/yoti/protobuf/sharepubapi/ExtraData_pb.rb +19 -0
  31. data/lib/yoti/protobuf/sharepubapi/IssuingAttributes_pb.rb +23 -0
  32. data/lib/yoti/protobuf/sharepubapi/ThirdPartyAttribute_pb.rb +20 -0
  33. data/lib/yoti/share/attribute_issuance_details.rb +43 -0
  34. data/lib/yoti/share/extra_data.rb +25 -0
  35. data/lib/yoti/ssl.rb +8 -0
  36. data/lib/yoti/util/age_processor.rb +4 -0
  37. data/lib/yoti/version.rb +1 -1
  38. data/rubocop.yml +4 -0
  39. data/yoti.gemspec +3 -3
  40. metadata +31 -14
  41. data/.travis.yml +0 -17
@@ -0,0 +1,19 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: ExtraData.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require_relative 'DataEntry_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message "sharepubapi_v1.ExtraData" do
9
+ repeated :list, :message, 1, "sharepubapi_v1.DataEntry"
10
+ end
11
+ end
12
+
13
+ module Yoti
14
+ module Protobuf
15
+ module Sharepubapi
16
+ ExtraData = Google::Protobuf::DescriptorPool.generated_pool.lookup("sharepubapi_v1.ExtraData").msgclass
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: IssuingAttributes.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "sharepubapi_v1.IssuingAttributes" do
8
+ optional :expiry_date, :string, 1
9
+ repeated :definitions, :message, 2, "sharepubapi_v1.Definition"
10
+ end
11
+ add_message "sharepubapi_v1.Definition" do
12
+ optional :name, :string, 1
13
+ end
14
+ end
15
+
16
+ module Yoti
17
+ module Protobuf
18
+ module Sharepubapi
19
+ IssuingAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("sharepubapi_v1.IssuingAttributes").msgclass
20
+ Definition = Google::Protobuf::DescriptorPool.generated_pool.lookup("sharepubapi_v1.Definition").msgclass
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: ThirdPartyAttribute.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require_relative 'IssuingAttributes_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message "sharepubapi_v1.ThirdPartyAttribute" do
9
+ optional :issuance_token, :bytes, 1
10
+ optional :issuing_attributes, :message, 2, "sharepubapi_v1.IssuingAttributes"
11
+ end
12
+ end
13
+
14
+ module Yoti
15
+ module Protobuf
16
+ module Sharepubapi
17
+ ThirdPartyAttribute = Google::Protobuf::DescriptorPool.generated_pool.lookup("sharepubapi_v1.ThirdPartyAttribute").msgclass
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'base64'
4
+
5
+ module Yoti
6
+ module Share
7
+ class Definition
8
+ attr_reader :name
9
+
10
+ #
11
+ # Constructor
12
+ #
13
+ # @param [String] name
14
+ #
15
+ def initialize(name)
16
+ @name = name
17
+ end
18
+ end
19
+
20
+ class AttributeIssuanceDetails
21
+ attr_reader :token
22
+ attr_reader :attributes
23
+ attr_reader :expiry_date
24
+
25
+ #
26
+ # Constructor
27
+ #
28
+ # @param [Yoti::Protobuf::Sharepubapi::ThirdPartyAttribute] data_entry
29
+ #
30
+ def initialize(data_entry)
31
+ @token = Base64.strict_encode64(data_entry.issuance_token)
32
+ begin
33
+ @expiry_date = DateTime.parse(data_entry.issuing_attributes.expiry_date)
34
+ rescue ArgumentError
35
+ @expiry_date = nil
36
+ end
37
+ @attributes = data_entry.issuing_attributes.definitions.map do |defn|
38
+ Definition.new(defn.name)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Yoti
4
+ module Share
5
+ class ExtraData
6
+ attr_reader :attribute_issuance_details
7
+
8
+ #
9
+ # Constructor
10
+ #
11
+ # @param [Yoti::Protobuf::Sharepubapi::ExtraData] proto
12
+ #
13
+ def initialize(proto)
14
+ @attribute_issuance_details = nil
15
+
16
+ proto.list.each do |data_entry|
17
+ if data_entry.type == :THIRD_PARTY_ATTRIBUTE && @attribute_issuance_details.nil?
18
+ attribute = Yoti::Protobuf::Sharepubapi::ThirdPartyAttribute.decode(data_entry.value)
19
+ @attribute_issuance_details = Yoti::Share::AttributeIssuanceDetails.new(attribute)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -59,6 +59,14 @@ module Yoti
59
59
  ssl_decipher.update(text) + ssl_decipher.final
60
60
  end
61
61
 
62
+ # Reset and reload the Private Key used for SSL functions
63
+ # @deprecated 2.0.0
64
+ def reload!
65
+ @private_key = nil
66
+ @pem = nil
67
+ nil
68
+ end
69
+
62
70
  private
63
71
 
64
72
  def private_key
@@ -1,5 +1,9 @@
1
1
  module Yoti
2
+ #
2
3
  # Process age attribute
4
+ #
5
+ # @deprecated 2.0.0 - replaced by Yoti::AgeVerification
6
+ #
3
7
  class AgeProcessor
4
8
  AGE_PATTERN = 'age_(over|under):[1-9][0-9]?[0-9]?'
5
9
 
@@ -1,4 +1,4 @@
1
1
  module Yoti
2
2
  # @return [String] the gem's current version
3
- VERSION = '1.5.0'.freeze
3
+ VERSION = '1.6.4'.freeze
4
4
  end
@@ -6,8 +6,10 @@ AllCops:
6
6
  - 'examples/rails/config/**/*'
7
7
  - 'lib/yoti/protobuf/attrpubapi/*'
8
8
  - 'lib/yoti/protobuf/compubapi/*'
9
+ - 'lib/yoti/protobuf/sharepubapi/*'
9
10
 
10
11
  Metrics/AbcSize:
12
+ Enabled: false
11
13
  Max: 23
12
14
  Exclude:
13
15
  - examples/rails/app/controllers/yoti_controller.rb
@@ -21,12 +23,14 @@ Metrics/CyclomaticComplexity:
21
23
  Max: 9
22
24
 
23
25
  Metrics/ClassLength:
26
+ Enabled: false
24
27
  Max: 115
25
28
 
26
29
  Metrics/LineLength:
27
30
  Enabled: false
28
31
 
29
32
  Metrics/MethodLength:
33
+ Enabled: false
30
34
  CountComments: false
31
35
  Max: 19
32
36
  Exclude:
@@ -18,15 +18,15 @@ Gem::Specification.new do |spec|
18
18
  spec.homepage = 'https://github.com/getyoti/yoti-ruby-sdk'
19
19
  spec.license = 'MIT'
20
20
 
21
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|examples)/}) }
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|examples)/|^sonar-project.properties$|^.dependabot/config.yml$|^.travis.yml$}) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.required_ruby_version = '>= 2.4'
25
25
 
26
- spec.add_dependency 'google-protobuf', '~> 3.7.0'
27
- spec.add_dependency 'protobuf', '~> 3.6'
26
+ spec.add_dependency 'google-protobuf', '~> 3.7'
28
27
 
29
28
  spec.add_development_dependency 'bundler', '~> 2.0'
29
+ spec.add_development_dependency 'coveralls', '~> 0.8'
30
30
  spec.add_development_dependency 'dotenv', '~> 2.2'
31
31
  spec.add_development_dependency 'generator_spec', '~> 0.9'
32
32
  spec.add_development_dependency 'rake', '~> 12.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Zaremba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.7.0
19
+ version: '3.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.7.0
26
+ version: '3.7'
27
27
  - !ruby/object:Gem::Dependency
28
- name: protobuf
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.6'
34
- type: :runtime
33
+ version: '2.0'
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.6'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: coveralls
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '0.8'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '0.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dotenv
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -174,8 +174,8 @@ executables: []
174
174
  extensions: []
175
175
  extra_rdoc_files: []
176
176
  files:
177
+ - ".github/ISSUE_TEMPLATE.md"
177
178
  - ".gitignore"
178
- - ".travis.yml"
179
179
  - CONTRIBUTING.md
180
180
  - Gemfile
181
181
  - Guardfile
@@ -188,16 +188,28 @@ files:
188
188
  - lib/yoti/activity_details.rb
189
189
  - lib/yoti/client.rb
190
190
  - lib/yoti/configuration.rb
191
+ - lib/yoti/data_type/age_verification.rb
191
192
  - lib/yoti/data_type/anchor.rb
192
193
  - lib/yoti/data_type/application_profile.rb
193
194
  - lib/yoti/data_type/attribute.rb
194
195
  - lib/yoti/data_type/base_profile.rb
196
+ - lib/yoti/data_type/document_details.rb
195
197
  - lib/yoti/data_type/image.rb
196
198
  - lib/yoti/data_type/image_jpeg.rb
197
199
  - lib/yoti/data_type/image_png.rb
198
200
  - lib/yoti/data_type/multi_value.rb
199
201
  - lib/yoti/data_type/profile.rb
200
202
  - lib/yoti/data_type/signed_time_stamp.rb
203
+ - lib/yoti/dynamic_share_service/dynamic_scenario.rb
204
+ - lib/yoti/dynamic_share_service/extension/extension.rb
205
+ - lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb
206
+ - lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb
207
+ - lib/yoti/dynamic_share_service/extension/transactional_flow_extension.rb
208
+ - lib/yoti/dynamic_share_service/policy/dynamic_policy.rb
209
+ - lib/yoti/dynamic_share_service/policy/source_constraint.rb
210
+ - lib/yoti/dynamic_share_service/policy/wanted_anchor.rb
211
+ - lib/yoti/dynamic_share_service/policy/wanted_attribute.rb
212
+ - lib/yoti/dynamic_share_service/share_url.rb
201
213
  - lib/yoti/errors.rb
202
214
  - lib/yoti/http/aml_check_request.rb
203
215
  - lib/yoti/http/payloads/aml_address.rb
@@ -212,6 +224,12 @@ files:
212
224
  - lib/yoti/protobuf/compubapi/EncryptedData_pb.rb
213
225
  - lib/yoti/protobuf/compubapi/SignedTimestamp_pb.rb
214
226
  - lib/yoti/protobuf/main.rb
227
+ - lib/yoti/protobuf/sharepubapi/DataEntry_pb.rb
228
+ - lib/yoti/protobuf/sharepubapi/ExtraData_pb.rb
229
+ - lib/yoti/protobuf/sharepubapi/IssuingAttributes_pb.rb
230
+ - lib/yoti/protobuf/sharepubapi/ThirdPartyAttribute_pb.rb
231
+ - lib/yoti/share/attribute_issuance_details.rb
232
+ - lib/yoti/share/extra_data.rb
215
233
  - lib/yoti/ssl.rb
216
234
  - lib/yoti/util/age_processor.rb
217
235
  - lib/yoti/util/anchor_processor.rb
@@ -240,8 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
258
  - !ruby/object:Gem::Version
241
259
  version: '0'
242
260
  requirements: []
243
- rubyforge_project:
244
- rubygems_version: 2.7.9
261
+ rubygems_version: 3.0.6
245
262
  signing_key:
246
263
  specification_version: 4
247
264
  summary: Yoti Ruby SDK for back-end integration.
@@ -1,17 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
- - 2.5
5
- - 2.6
6
-
7
- git:
8
- depth: 1
9
-
10
- before_install:
11
- - gem install bundler
12
-
13
- install:
14
- - bundle install
15
-
16
- script:
17
- - bundle exec rake