yoti 1.6.4 → 1.10.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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +22 -224
  4. data/lib/yoti.rb +63 -1
  5. data/lib/yoti/activity_details.rb +3 -5
  6. data/lib/yoti/client.rb +13 -4
  7. data/lib/yoti/configuration.rb +8 -3
  8. data/lib/yoti/data_type/age_verification.rb +1 -1
  9. data/lib/yoti/data_type/base_profile.rb +1 -1
  10. data/lib/yoti/data_type/document_details.rb +1 -1
  11. data/lib/yoti/data_type/image.rb +4 -12
  12. data/lib/yoti/data_type/image_jpeg.rb +2 -0
  13. data/lib/yoti/data_type/image_png.rb +2 -0
  14. data/lib/yoti/data_type/media.rb +22 -0
  15. data/lib/yoti/data_type/signed_time_stamp.rb +1 -1
  16. data/lib/yoti/doc_scan/client.rb +191 -0
  17. data/lib/yoti/doc_scan/constants.rb +35 -0
  18. data/lib/yoti/doc_scan/errors.rb +81 -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/objective/objective.rb +31 -0
  24. data/lib/yoti/doc_scan/session/create/objective/proof_of_address_objective.rb +31 -0
  25. data/lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb +150 -0
  26. data/lib/yoti/doc_scan/session/create/requested_check.rb +39 -0
  27. data/lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb +95 -0
  28. data/lib/yoti/doc_scan/session/create/requested_face_match_check.rb +95 -0
  29. data/lib/yoti/doc_scan/session/create/requested_id_document_comparison_check.rb +53 -0
  30. data/lib/yoti/doc_scan/session/create/requested_liveness_check.rb +108 -0
  31. data/lib/yoti/doc_scan/session/create/requested_supplementary_doc_text_extraction_task.rb +94 -0
  32. data/lib/yoti/doc_scan/session/create/requested_task.rb +39 -0
  33. data/lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb +116 -0
  34. data/lib/yoti/doc_scan/session/create/required_document.rb +31 -0
  35. data/lib/yoti/doc_scan/session/create/required_id_document.rb +53 -0
  36. data/lib/yoti/doc_scan/session/create/required_supplementary_document.rb +90 -0
  37. data/lib/yoti/doc_scan/session/create/sdk_config.rb +221 -0
  38. data/lib/yoti/doc_scan/session/create/session_specification.rb +221 -0
  39. data/lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb +12 -0
  40. data/lib/yoti/doc_scan/session/retrieve/breakdown_response.rb +38 -0
  41. data/lib/yoti/doc_scan/session/retrieve/check_response.rb +63 -0
  42. data/lib/yoti/doc_scan/session/retrieve/details_response.rb +28 -0
  43. data/lib/yoti/doc_scan/session/retrieve/document_fields_response.rb +21 -0
  44. data/lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb +21 -0
  45. data/lib/yoti/doc_scan/session/retrieve/face_map_response.rb +21 -0
  46. data/lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb +12 -0
  47. data/lib/yoti/doc_scan/session/retrieve/file_response.rb +21 -0
  48. data/lib/yoti/doc_scan/session/retrieve/frame_response.rb +21 -0
  49. data/lib/yoti/doc_scan/session/retrieve/generated_check_response.rb +28 -0
  50. data/lib/yoti/doc_scan/session/retrieve/generated_media.rb +28 -0
  51. data/lib/yoti/doc_scan/session/retrieve/generated_supplementary_document_text_data_check_response.rb +12 -0
  52. data/lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb +12 -0
  53. data/lib/yoti/doc_scan/session/retrieve/get_session_result.rb +145 -0
  54. data/lib/yoti/doc_scan/session/retrieve/id_document_comparison_check_response.rb +12 -0
  55. data/lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb +57 -0
  56. data/lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb +12 -0
  57. data/lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb +24 -0
  58. data/lib/yoti/doc_scan/session/retrieve/media_response.rb +38 -0
  59. data/lib/yoti/doc_scan/session/retrieve/page_response.rb +37 -0
  60. data/lib/yoti/doc_scan/session/retrieve/recommendation_response.rb +34 -0
  61. data/lib/yoti/doc_scan/session/retrieve/report_response.rb +31 -0
  62. data/lib/yoti/doc_scan/session/retrieve/resource_container.rb +69 -0
  63. data/lib/yoti/doc_scan/session/retrieve/resource_response.rb +41 -0
  64. data/lib/yoti/doc_scan/session/retrieve/supplementary_document_resource_response.rb +57 -0
  65. data/lib/yoti/doc_scan/session/retrieve/supplementary_document_text_data_check_response.rb +12 -0
  66. data/lib/yoti/doc_scan/session/retrieve/supplementary_document_text_extraction_task_response.rb +18 -0
  67. data/lib/yoti/doc_scan/session/retrieve/task_response.rb +89 -0
  68. data/lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb +12 -0
  69. data/lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb +18 -0
  70. data/lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb +33 -0
  71. data/lib/yoti/doc_scan/support/supported_documents.rb +60 -0
  72. data/lib/yoti/dynamic_share_service/dynamic_scenario.rb +5 -0
  73. data/lib/yoti/dynamic_share_service/extension/extension.rb +3 -0
  74. data/lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb +3 -0
  75. data/lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb +1 -1
  76. data/lib/yoti/dynamic_share_service/extension/transactional_flow_extension.rb +4 -0
  77. data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +74 -9
  78. data/lib/yoti/dynamic_share_service/policy/wanted_anchor.rb +3 -0
  79. data/lib/yoti/dynamic_share_service/policy/wanted_attribute.rb +5 -0
  80. data/lib/yoti/dynamic_share_service/share_url.rb +26 -33
  81. data/lib/yoti/errors.rb +15 -2
  82. data/lib/yoti/http/aml_check_request.rb +12 -6
  83. data/lib/yoti/http/payloads/aml_address.rb +4 -0
  84. data/lib/yoti/http/payloads/aml_profile.rb +7 -1
  85. data/lib/yoti/http/profile_request.rb +11 -6
  86. data/lib/yoti/http/request.rb +219 -18
  87. data/lib/yoti/http/signed_request.rb +13 -4
  88. data/lib/yoti/protobuf/main.rb +8 -8
  89. data/lib/yoti/share/attribute_issuance_details.rb +6 -0
  90. data/lib/yoti/ssl.rb +4 -4
  91. data/lib/yoti/util/age_processor.rb +1 -1
  92. data/lib/yoti/util/anchor_processor.rb +2 -2
  93. data/lib/yoti/util/log.rb +1 -1
  94. data/lib/yoti/util/validation.rb +41 -0
  95. data/lib/yoti/version.rb +1 -1
  96. data/yoti.gemspec +18 -6
  97. metadata +69 -33
  98. data/.github/ISSUE_TEMPLATE.md +0 -17
  99. data/.gitignore +0 -39
  100. data/CONTRIBUTING.md +0 -98
  101. data/Guardfile +0 -11
  102. data/Rakefile +0 -54
  103. data/login_flow.png +0 -0
  104. data/rubocop.yml +0 -57
  105. data/yardstick.yml +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1d2cbb57b376a252d798c35820fcee63a46eb99809422441e592ed25bc0f9da
4
- data.tar.gz: 1e31e86853d8e419cad2bec50a260d9e26a9c8043299ff6dc10620635c9169c9
3
+ metadata.gz: 76c473c29aaa7900698cd353fd4efbadf1d58e2e71e02e5ab13671a0da360334
4
+ data.tar.gz: 542da906f9709554119c66fa81d0b2629ab0c783f9412c70c4fa754330cc2199
5
5
  SHA512:
6
- metadata.gz: 88a932e08b8b73b81ef7153935e984df1d0816c9cfdf0fe912342a57ca8b12a91892aec6b226520cd48f94b660264dca2cadd593ef85008dc2564c97c811a409
7
- data.tar.gz: 1b0bdb68176391c56302aff5bda6040aece1d891d6b4491ea605af30029c079de046ea6e03df81c49c99100a1500a0730adfbc6e705c69f18c2a6c96172f0c09
6
+ metadata.gz: c3fa9ca3fbe4953ca94543bac7bf5edb663b751065bdb8395f963274302c6290be51c45baa2c90a5094b9b7efb15f90c2e5b8af17531ecf25dd6b64691b3079d
7
+ data.tar.gz: dd28ffbcdfa70f9d9b4ccc95163582c41a2113189376912e68f3bd622b95931465f9ef68788b7ead2f4841240144811207bd6f1ca0df64ff011cb78c2d9fe9c9
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'guard'
4
4
  gem 'guard-rspec'
5
- gem 'rubocop'
5
+ gem 'rubocop', '~> 1.1', require: false
6
6
  gem 'rubocop-performance'
7
7
 
8
8
  gemspec
data/README.md CHANGED
@@ -1,44 +1,25 @@
1
1
  # Yoti Ruby SDK
2
2
 
3
3
  [![Build Status](https://travis-ci.com/getyoti/yoti-ruby-sdk.svg?branch=master)](https://travis-ci.com/getyoti/yoti-ruby-sdk)
4
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aruby&metric=coverage)](https://sonarcloud.io/dashboard?id=getyoti%3Aruby)
5
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aruby&metric=bugs)](https://sonarcloud.io/dashboard?id=getyoti%3Aruby)
6
+ [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aruby&metric=code_smells)](https://sonarcloud.io/dashboard?id=getyoti%3Aruby)
7
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aruby&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=getyoti%3Aruby)
4
8
 
5
9
  Welcome to the Yoti Ruby SDK. This repository contains the tools you need to quickly integrate your Ruby back-end with Yoti so that your users can share their identity details with your application in a secure and trusted way.
6
10
 
7
11
  ## Table of Contents
8
12
 
9
- 1. [An Architectural view](#an-architectural-view) - High level overview of integration
10
13
  1. [Requirements](#requirements) - Everything you need to get started
11
- 1. [Installing the SDK](#installing-the-sdk) - How to install our SDK
12
- 1. [Configuration](#configuration) - Configuring the SDK
13
- 1. [Profile Retrieval](#profile-retrieval) - How to retrieve a Yoti profile using the one time use token
14
- 1. [AML Integration](#aml-integration) - How to integrate with Yoti's AML (Anti Money Laundering) service
15
- 1. [Running the Examples](#running-the-examples) - How to run the example projects provided
16
- 1. [API Coverage](#api-coverage) - Attributes defined
17
- 1. [Support](#support) - Please feel free to reach out
18
-
19
- ## An Architectural view
20
-
21
- To integrate your application with Yoti, your back-end must expose a GET endpoint that Yoti will use to forward tokens.
22
- The endpoint is configured in the [Yoti Hub](https://hub.yoti.com) where you create/update your application. To see an example of how this is configured, see the [Running the Examples](#running-the-examples) section.
23
14
 
24
- The image below shows how your application back-end and Yoti integrate into the context of a Login flow.
25
- Yoti SDK carries out for you steps 6, 7, 8 and the profile decryption in step 9.
26
-
27
- ![alt text](login_flow.png "Login flow")
28
-
29
- Yoti also allows you to enable user details verification from your mobile app by means of the Android (TBA) and iOS (TBA) SDKs. In that scenario, your Yoti-enabled mobile app is playing both the role of the browser and the Yoti app. Your back-end doesn't need to handle these cases in a significantly different way, but you might decide to handle the `User-Agent` header in order to provide different responses for desktop and mobile clients.
15
+ 1. [Installing the SDK](#installing-the-sdk) - How to install our SDK
30
16
 
31
- ## References
17
+ 1. [Setup](#setup) - Setup required before using the Yoti services
32
18
 
33
- * [AES-256 symmetric encryption][]
34
- * [RSA pkcs asymmetric encryption][]
35
- * [Protocol buffers][]
36
- * [Base64 data][]
19
+ 1. [Products](#products) -
20
+ Links to more information about the products offered by the Yoti SDK
37
21
 
38
- [AES-256 symmetric encryption]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
39
- [RSA pkcs asymmetric encryption]: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
40
- [Protocol buffers]: https://en.wikipedia.org/wiki/Protocol_Buffers
41
- [Base64 data]: https://en.wikipedia.org/wiki/Base64
22
+ 1. [Support](#support) - Please feel free to reach out
42
23
 
43
24
  ## Requirements
44
25
 
@@ -72,7 +53,7 @@ bundle install
72
53
  Or simply run the following command from your terminal:
73
54
 
74
55
  ```shell
75
- [sudo] gem install yoti
56
+ gem install yoti
76
57
  ```
77
58
 
78
59
  ## SDK Project Import
@@ -85,7 +66,12 @@ rails generate yoti:install
85
66
 
86
67
  The generated initialisation file can be found in `config/initializers/yoti.rb`.
87
68
 
88
- ## Configuration
69
+ ## Setup
70
+
71
+ For each service you will need:
72
+
73
+ * Your Client SDK ID, generated by [Yoti Hub](https://hub.yoti.com) when you create (and then publish) your app.
74
+ * Your .pem file. This is your own unique private key which your browser generates from the [Yoti Hub](https://hub.yoti.com) when you create an application.
89
75
 
90
76
  A minimal Yoti client initialisation looks like this:
91
77
 
@@ -97,10 +83,8 @@ end
97
83
  ```
98
84
 
99
85
  Make sure the following environment variables can be accessed by your app:
100
-
101
- `YOTI_CLIENT_SDK_ID` - found on the Key settings page on your Yoti Hub
102
-
103
- `YOTI_KEY_FILE_PATH` - the full path to your security key downloaded from the *Keys* settings page (e.g. /Users/developer/access-security.pem)
86
+ - `YOTI_CLIENT_SDK_ID`
87
+ - `YOTI_KEY_FILE_PATH`
104
88
 
105
89
  The following options are available:
106
90
 
@@ -140,197 +124,11 @@ heroku config:add YOTI_KEY ="$(cat your-access-security.pem)"
140
124
 
141
125
  [Heroku Command Line]: https://devcenter.heroku.com/articles/heroku-command-line
142
126
 
143
- ## Profile Retrieval
144
-
145
- When your application receives a one time use token via the exposed endpoint (it will be assigned to a query string parameter named `token`), you can easily retrieve the user profile:
146
-
147
- ```ruby
148
- one_time_use_token = params[:token]
149
- yoti_activity_details = Yoti::Client.get_activity_details(one_time_use_token)
150
- ```
151
-
152
- Before you inspect the user profile, you might want to check whether the user validation was successful. This is done as follows:
153
-
154
- ```ruby
155
- if yoti_activity_details.outcome == 'SUCCESS'
156
- profile = yoti_activity_details.profile
157
- given_names = profile.given_names.value
158
- family_name = profile.family_name.value
159
- else
160
- # handle unhappy path
161
- end
162
- ```
163
-
164
- The `profile` object provides a set of attributes corresponding to user attributes. Whether the attributes are present or not depends on the settings you have applied to your app on Yoti Hub.
165
-
166
- ### Handling Users
167
-
168
- When you retrieve the user profile, you receive a user ID generated by Yoti exclusively for your application.
169
- This means that if the same individual logs into another app, Yoti will assign her/him a different ID.
170
- You can use this ID to verify whether (for your application) the retrieved profile identifies a new or an existing user.
171
- Here is an example of how this works:
172
-
173
- ```ruby
174
- if yoti_activity_details.outcome == 'SUCCESS'
175
- user = your_user_search_function(yoti_activity_details.user_id)
176
- profile = yoti_activity_details.profile
177
-
178
- if user
179
- # handle login
180
- email = profile.email_address.value
181
- else
182
- # handle registration
183
- given_names = profile.given_names.value
184
- family_name = profile.family_name.value
185
- email = profile.email_address.value
186
- end
187
- else
188
- # handle unhappy path
189
- end
190
- ```
191
-
192
- Where `your_user_search_function` is a piece of logic in your app that is supposed to find a user, given a user_id. Regardless of whether the user is a new or an existing one, Yoti will always provide their profile, so you don't necessarily need to store it.
193
-
194
- You can retrieve the sources and verifiers for each attribute as follows:
195
-
196
- ```ruby
197
- given_names_sources = profile.given_names.sources # list of anchors
198
- given_names_verifiers = profile.given_names.verifiers # list of anchors
199
- given_names_anchors = profile.given_names.anchors # list of anchors
200
- ```
201
- You can also retrieve further properties from these respective anchors in the following way:
202
-
203
- ```ruby
204
- # Retrieving properties of the first anchor
205
- type = given_names_sources[0].type # string
206
- value = given_names_sources[0].value # string
207
- sub_type = given_names_sources[0].sub_type # string
208
- time_stamp = given_names_sources[0].signed_time_stamp.time_stamp # DateTime object
209
- origin_server_certs = given_names_sources[0].origin_server_certs # list of X509 certificates
210
- ```
211
-
212
- In case you want to prove the sources and verifiers of the helper`ActivityDetails.age_verified` on `Age Over 18` set as age derivation, please retrieve it's original attribute from the profile as follow:
213
-
214
- ```ruby
215
- age_attribute = profile.get_attribute('age_over:18')
216
- sources = age_attribute.sources
217
- verifiers = age_attribute.verifiers
218
- anchors = age_attribute.anchors
219
- ```
220
-
221
- ## AML Integration
222
-
223
- Yoti provides an AML (Anti Money Laundering) check service to allow a deeper KYC process to prevent fraud. This is a chargeable service, so please contact [sdksupport@yoti.com](mailto:sdksupport@yoti.com) for more information.
224
-
225
- Yoti will provide a boolean result on the following checks:
226
-
227
- * PEP list - Verify against Politically Exposed Persons list
228
- * Fraud list - Verify against US Social Security Administration Fraud (SSN Fraud) list
229
- * Watch list - Verify against watch lists from the Office of Foreign Assets Control
230
-
231
- To use this functionality you must ensure your application is assigned to your organisation in the Yoti Hub - please see [here](https://developers.yoti.com/yoti-app-integration/yoti-app-integration#step-1-creating-an-organisation) for further information.
232
-
233
- For the AML check you will need to provide the following:
234
-
235
- * Data provided by Yoti (please ensure you have selected the Given name(s) and Family name attributes for your scenario on the Yoti Hub)
236
- * Given name(s)
237
- * Family name
238
- * Data that must be collected from the user:
239
- * Country of residence (must be an ISO 3166 3-letter code)
240
- * Social Security Number (US citizens only)
241
- * Postcode/Zip code (US citizens only)
242
-
243
- ### Consent
244
-
245
- Performing an AML check on a person *requires* their consent.
246
- **You must ensure you have user consent *before* using this service.**
247
-
248
- ### Code Example
249
-
250
- Given a YotiClient initialised with your SDK ID and KeyPair (see [Client Initialisation](#client-initialisation)) performing an AML check is a straightforward case of providing basic profile data.
251
-
252
- ```ruby
253
- require 'yoti'
254
-
255
- Yoti.configure do |config|
256
- config.client_sdk_id = ENV['YOTI_CLIENT_SDK_ID']
257
- config.key_file_path = ENV['YOTI_KEY_FILE_PATH']
258
- end
259
-
260
- aml_address = Yoti::AmlAddress.new('GBR')
261
- aml_profile = Yoti::AmlProfile.new('Edward Richard George', 'Heath', aml_address)
262
-
263
- puts Yoti::Client.aml_check(aml_profile)
264
- ```
127
+ ## Products
265
128
 
266
- ## Running the Examples
267
-
268
- The examples can be found in the [examples folder](examples).
269
-
270
- ### Ruby on Rails
271
-
272
- 1. Create your application in the [Yoti Hub](https://hub.yoti.com)
273
- 1. Set the application domain of your app to `localhost:3001`
274
- 1. Set the scenario callback URL to `/profile`
275
- 1. Rename the [.env.example](examples/rails/.env.example) file to `.env`
276
- 1. Fill in the environment variables in this file with the ones specific to your application (mentioned in the [Configuration](#configuration) section)
277
- 1. Install the dependencies by running the following commands
278
- ```ruby
279
- $ bundle install
280
- $ gem install foreman # We are doing this as it's not recommended to include foreman in your Gemfile
281
- ```
282
- 1. Start the server `foreman start`
283
-
284
- Visiting `https://localhost:3001/` should show a Yoti Connect button
285
-
286
- ### Sinatra
287
-
288
- 1. Create your application in the [Yoti Hub](https://hub.yoti.com)
289
- 1. Set the application domain of your app to `localhost:4567`
290
- 1. Set the scenario callback URL to `/profile`
291
- 1. Rename the [.env.example](examples/sinatra/.env.example) file to `.env`
292
- 1. Fill in the environment variables in this file with the ones specific to your application (mentioned in the [Configuration](#configuration) section)
293
- 1. Install the dependencies by running the following commands
294
- ```ruby
295
- $ bundle install
296
- $ gem install foreman # We are doing this as it's not recommended to include foreman in your Gemfile
297
- ```
298
- 1. Start the server `foreman start`
299
-
300
- Visiting `https://localhost:4567/` should show a Yoti Connect button
301
-
302
- ### AML Check
303
-
304
- * rename the [.env.example](examples/aml_check/.env.example) file to `.env` and fill in the required configuration values
305
- * install the dependencies with `bundle install`
306
- * run the script with `ruby ./app.rb`
307
-
308
- ## API Coverage
309
-
310
- * Activity Details
311
- * [X] Remember Me ID `remember_me_id`
312
- * [X] Parent Remember Me ID `parent_remember_me_id`
313
- * [X] Receipt ID `receipt_id`
314
- * [X] Timestamp `timestamp`
315
- * [X] Base64 Selfie URI `base64_selfie_uri`
316
- * [X] Age verified `age_verified`
317
- * [X] Profile `profile`
318
- * [X] Selfie `selfie`
319
- * [X] Full Name `full_name`
320
- * [X] Given Names `given_names`
321
- * [X] Family Name `family_name`
322
- * [X] Mobile Number `phone_number`
323
- * [X] Email Address `email_address`
324
- * [X] Age / Date of Birth `date_of_birth`
325
- * [X] Address `postal_address`
326
- * [X] Structured Postal Address `structured_postal_address`
327
- * [X] Gender `gender`
328
- * [X] Nationality `nationality`
329
- * [X] Application Profile `application_profile`
330
- * [X] Name `name`
331
- * [X] URL `url`
332
- * [X] Logo `logo`
333
- * [X] Receipt Background Color `receipt_bgcolor`
129
+ The Yoti SDK can be used for the following products, follow the links for more information about each:
130
+ 1) [Yoti app integration](/docs/PROFILE.md) - Connect with already-verified customers.
131
+ 1) [Yoti Doc Scan](/docs/DOCSCAN.md) - Identity verification embedded in your website or app.
334
132
 
335
133
  ## Support
336
134
 
@@ -18,6 +18,7 @@ require_relative 'yoti/data_type/application_profile'
18
18
  require_relative 'yoti/data_type/profile'
19
19
  require_relative 'yoti/data_type/attribute'
20
20
  require_relative 'yoti/data_type/signed_time_stamp'
21
+ require_relative 'yoti/data_type/media'
21
22
  require_relative 'yoti/data_type/image'
22
23
  require_relative 'yoti/data_type/image_jpeg'
23
24
  require_relative 'yoti/data_type/image_png'
@@ -26,7 +27,8 @@ require_relative 'yoti/data_type/document_details'
26
27
 
27
28
  require_relative 'yoti/util/age_processor'
28
29
  require_relative 'yoti/util/anchor_processor'
29
- require_relative 'yoti/util/log.rb'
30
+ require_relative 'yoti/util/log'
31
+ require_relative 'yoti/util/validation'
30
32
 
31
33
  require_relative 'yoti/activity_details'
32
34
  require_relative 'yoti/client'
@@ -47,6 +49,66 @@ require_relative 'yoti/dynamic_share_service/extension/thirdparty_attribute_exte
47
49
  require_relative 'yoti/share/extra_data'
48
50
  require_relative 'yoti/share/attribute_issuance_details'
49
51
 
52
+ require_relative 'yoti/doc_scan/client'
53
+ require_relative 'yoti/doc_scan/constants'
54
+ require_relative 'yoti/doc_scan/errors'
55
+
56
+ require_relative 'yoti/doc_scan/session/create/create_session_result'
57
+ require_relative 'yoti/doc_scan/session/create/requested_check'
58
+ require_relative 'yoti/doc_scan/session/create/requested_document_authenticity_check'
59
+ require_relative 'yoti/doc_scan/session/create/requested_id_document_comparison_check'
60
+ require_relative 'yoti/doc_scan/session/create/requested_face_match_check'
61
+ require_relative 'yoti/doc_scan/session/create/requested_liveness_check'
62
+ require_relative 'yoti/doc_scan/session/create/requested_task'
63
+ require_relative 'yoti/doc_scan/session/create/requested_text_extraction_task'
64
+ require_relative 'yoti/doc_scan/session/create/requested_supplementary_doc_text_extraction_task'
65
+ require_relative 'yoti/doc_scan/session/create/objective/objective'
66
+ require_relative 'yoti/doc_scan/session/create/objective/proof_of_address_objective'
67
+ require_relative 'yoti/doc_scan/session/create/document_filter'
68
+ require_relative 'yoti/doc_scan/session/create/document_restrictions_filter'
69
+ require_relative 'yoti/doc_scan/session/create/orthogonal_restrictions_filter'
70
+ require_relative 'yoti/doc_scan/session/create/required_document'
71
+ require_relative 'yoti/doc_scan/session/create/required_id_document'
72
+ require_relative 'yoti/doc_scan/session/create/required_supplementary_document'
73
+ require_relative 'yoti/doc_scan/session/create/sdk_config'
74
+ require_relative 'yoti/doc_scan/session/create/notification_config'
75
+ require_relative 'yoti/doc_scan/session/create/session_specification'
76
+
77
+ require_relative 'yoti/doc_scan/session/retrieve/check_response'
78
+ require_relative 'yoti/doc_scan/session/retrieve/resource_response'
79
+ require_relative 'yoti/doc_scan/session/retrieve/authenticity_check_response'
80
+ require_relative 'yoti/doc_scan/session/retrieve/id_document_comparison_check_response'
81
+ require_relative 'yoti/doc_scan/session/retrieve/breakdown_response'
82
+ require_relative 'yoti/doc_scan/session/retrieve/details_response'
83
+ require_relative 'yoti/doc_scan/session/retrieve/document_fields_response'
84
+ require_relative 'yoti/doc_scan/session/retrieve/document_id_photo_response'
85
+ require_relative 'yoti/doc_scan/session/retrieve/face_map_response'
86
+ require_relative 'yoti/doc_scan/session/retrieve/face_match_check_response'
87
+ require_relative 'yoti/doc_scan/session/retrieve/file_response'
88
+ require_relative 'yoti/doc_scan/session/retrieve/frame_response'
89
+ require_relative 'yoti/doc_scan/session/retrieve/generated_check_response'
90
+ require_relative 'yoti/doc_scan/session/retrieve/generated_media'
91
+ require_relative 'yoti/doc_scan/session/retrieve/generated_text_data_check_response'
92
+ require_relative 'yoti/doc_scan/session/retrieve/generated_supplementary_document_text_data_check_response'
93
+ require_relative 'yoti/doc_scan/session/retrieve/get_session_result'
94
+ require_relative 'yoti/doc_scan/session/retrieve/id_document_resource_response'
95
+ require_relative 'yoti/doc_scan/session/retrieve/supplementary_document_resource_response'
96
+ require_relative 'yoti/doc_scan/session/retrieve/liveness_check_response'
97
+ require_relative 'yoti/doc_scan/session/retrieve/liveness_resource_response'
98
+ require_relative 'yoti/doc_scan/session/retrieve/media_response'
99
+ require_relative 'yoti/doc_scan/session/retrieve/page_response'
100
+ require_relative 'yoti/doc_scan/session/retrieve/recommendation_response'
101
+ require_relative 'yoti/doc_scan/session/retrieve/report_response'
102
+ require_relative 'yoti/doc_scan/session/retrieve/resource_container'
103
+ require_relative 'yoti/doc_scan/session/retrieve/task_response'
104
+ require_relative 'yoti/doc_scan/session/retrieve/text_data_check_response'
105
+ require_relative 'yoti/doc_scan/session/retrieve/text_extraction_task_response'
106
+ require_relative 'yoti/doc_scan/session/retrieve/zoom_liveness_resource_response'
107
+ require_relative 'yoti/doc_scan/session/retrieve/supplementary_document_text_data_check_response'
108
+ require_relative 'yoti/doc_scan/session/retrieve/supplementary_document_text_extraction_task_response'
109
+
110
+ require_relative 'yoti/doc_scan/support/supported_documents'
111
+
50
112
  # The main module namespace of the Yoti gem
51
113
  module Yoti
52
114
  class << self
@@ -61,7 +61,7 @@ module Yoti
61
61
  #
62
62
  # The age under/over attribute
63
63
  #
64
- # @deprecated 2.0.0 - replaced by:
64
+ # @deprecated will be removed in 2.0.0 - replaced by:
65
65
  # - Yoti::Profile#age_verifications
66
66
  # - Yoti::Profile#find_age_over_verification
67
67
  # - Yoti::Profile#find_age_under_verification
@@ -108,9 +108,7 @@ module Yoti
108
108
  @extended_user_profile = process_decrypted_profile(decrypted_profile)
109
109
  @extended_application_profile = process_decrypted_profile(decrypted_application_profile)
110
110
  @extra_data = extra_data
111
- @user_profile = @extended_user_profile.map do |name, attribute|
112
- [name, attribute.value]
113
- end.to_h
111
+ @user_profile = @extended_user_profile.transform_values(&:value)
114
112
  end
115
113
 
116
114
  #
@@ -195,7 +193,7 @@ module Yoti
195
193
  #
196
194
  # Processes age verification
197
195
  #
198
- # @deprecated 2.0.0
196
+ # @deprecated will be removed in 2.0.0
199
197
  #
200
198
  # @param [Yoti::Protobuf::Attrpubapi::Attribute] attribute
201
199
  #
@@ -1,15 +1,17 @@
1
1
  module Yoti
2
2
  #
3
- # Handles all the publicly accesible Yoti methods for
4
- # geting data using an encrypted connect token
3
+ # Handles all the publicly accessible Yoti methods for
4
+ # getting data using an encrypted connect token
5
5
  #
6
6
  module Client
7
7
  #
8
8
  # Performs all the steps required to get the decrypted profile from an API request
9
9
  #
10
- # @param encrypted_connect_token [String] token provided as a base 64 string
10
+ # @param [String] encrypted_connect_token
11
+ # Token provided as a base 64 string
11
12
  #
12
- # @return [Object] an ActivityDetails instance encapsulating the user profile
13
+ # @return [ActivityDetails]
14
+ # An ActivityDetails instance encapsulating the user profile
13
15
  #
14
16
  def self.get_activity_details(encrypted_connect_token)
15
17
  receipt = Yoti::ProfileRequest.new(encrypted_connect_token).receipt
@@ -22,6 +24,13 @@ module Yoti
22
24
  ActivityDetails.new(receipt, user_profile, application_profile, extra_data)
23
25
  end
24
26
 
27
+ #
28
+ # Perform AML check
29
+ #
30
+ # @param [AmlProfile] aml_profile
31
+ #
32
+ # @return [<Hash>]
33
+ #
25
34
  def self.aml_check(aml_profile)
26
35
  Yoti::AmlCheckRequest.new(aml_profile).response
27
36
  end