yoti 1.6.3 → 1.9.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 +4 -4
  2. data/README.md +22 -224
  3. data/lib/yoti.rb +54 -1
  4. data/lib/yoti/client.rb +13 -4
  5. data/lib/yoti/configuration.rb +7 -2
  6. data/lib/yoti/data_type/age_verification.rb +1 -1
  7. data/lib/yoti/data_type/base_profile.rb +1 -1
  8. data/lib/yoti/data_type/image.rb +4 -12
  9. data/lib/yoti/data_type/image_jpeg.rb +2 -0
  10. data/lib/yoti/data_type/image_png.rb +2 -0
  11. data/lib/yoti/data_type/media.rb +19 -0
  12. data/lib/yoti/data_type/signed_time_stamp.rb +1 -1
  13. data/lib/yoti/doc_scan/client.rb +187 -0
  14. data/lib/yoti/doc_scan/constants.rb +31 -0
  15. data/lib/yoti/doc_scan/errors.rb +81 -0
  16. data/lib/yoti/doc_scan/session/create/create_session_result.rb +50 -0
  17. data/lib/yoti/doc_scan/session/create/document_filter.rb +31 -0
  18. data/lib/yoti/doc_scan/session/create/document_restrictions_filter.rb +140 -0
  19. data/lib/yoti/doc_scan/session/create/notification_config.rb +142 -0
  20. data/lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb +150 -0
  21. data/lib/yoti/doc_scan/session/create/requested_check.rb +39 -0
  22. data/lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb +95 -0
  23. data/lib/yoti/doc_scan/session/create/requested_face_match_check.rb +95 -0
  24. data/lib/yoti/doc_scan/session/create/requested_id_document_comparison_check.rb +53 -0
  25. data/lib/yoti/doc_scan/session/create/requested_liveness_check.rb +108 -0
  26. data/lib/yoti/doc_scan/session/create/requested_task.rb +39 -0
  27. data/lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb +116 -0
  28. data/lib/yoti/doc_scan/session/create/required_document.rb +31 -0
  29. data/lib/yoti/doc_scan/session/create/required_id_document.rb +53 -0
  30. data/lib/yoti/doc_scan/session/create/sdk_config.rb +221 -0
  31. data/lib/yoti/doc_scan/session/create/session_specification.rb +221 -0
  32. data/lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb +12 -0
  33. data/lib/yoti/doc_scan/session/retrieve/breakdown_response.rb +38 -0
  34. data/lib/yoti/doc_scan/session/retrieve/check_response.rb +63 -0
  35. data/lib/yoti/doc_scan/session/retrieve/details_response.rb +28 -0
  36. data/lib/yoti/doc_scan/session/retrieve/document_fields_response.rb +21 -0
  37. data/lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb +21 -0
  38. data/lib/yoti/doc_scan/session/retrieve/face_map_response.rb +21 -0
  39. data/lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb +12 -0
  40. data/lib/yoti/doc_scan/session/retrieve/frame_response.rb +21 -0
  41. data/lib/yoti/doc_scan/session/retrieve/generated_check_response.rb +28 -0
  42. data/lib/yoti/doc_scan/session/retrieve/generated_media.rb +28 -0
  43. data/lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb +12 -0
  44. data/lib/yoti/doc_scan/session/retrieve/get_session_result.rb +127 -0
  45. data/lib/yoti/doc_scan/session/retrieve/id_document_comparison_check_response.rb +12 -0
  46. data/lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb +57 -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 +62 -11
  61. data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +84 -22
  62. data/lib/yoti/dynamic_share_service/share_url.rb +28 -33
  63. data/lib/yoti/errors.rb +15 -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 +221 -18
  69. data/lib/yoti/http/signed_request.rb +13 -4
  70. data/lib/yoti/protobuf/main.rb +1 -1
  71. data/lib/yoti/ssl.rb +2 -2
  72. data/lib/yoti/util/anchor_processor.rb +1 -1
  73. data/lib/yoti/util/validation.rb +41 -0
  74. data/lib/yoti/version.rb +1 -1
  75. data/yoti.gemspec +19 -9
  76. metadata +60 -67
  77. data/.github/ISSUE_TEMPLATE.md +0 -17
  78. data/.gitignore +0 -39
  79. data/CONTRIBUTING.md +0 -127
  80. data/Guardfile +0 -11
  81. data/Rakefile +0 -49
  82. data/login_flow.png +0 -0
  83. data/rubocop.yml +0 -57
  84. data/yardstick.yml +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 296612e32508787e11d3c6f9404434b9d9575284008ae7d60df4a20f83526f6f
4
- data.tar.gz: 4e0e6a0c0ea6a297399df4a9937ae3e6cd82da95f67d5a70b8cc7db0665e5c50
3
+ metadata.gz: 62813310617665f67200974ba737f52d7c9bd2c1b139657b5ec672253ab3d133
4
+ data.tar.gz: 474d9dff07562499e19ec35d261dadbc056dbe7818bf35620ba7247ea7169569
5
5
  SHA512:
6
- metadata.gz: fc8a50eab70a1b29ba480e7df303144d56b4edb46b48124292dbfb98de9167659eee80b2d38e0c633c709151953252cb888dad5f2114c721eed8871915b3f0b2
7
- data.tar.gz: 2c8dcc5342813067af5fb6980ef0acb8c5c8f2981c23fbf4311261a46034f852ba35b1c028a6cfed33c5fda52d0b193cb857e145cbafa4b342e0377e0ff2effb
6
+ metadata.gz: 5c9c3ddc325973e5da3598c289428f01ccb7964ef7faed15b56faa7d9067b5f34f20a2b3336e1b357fb388898810595ccdc1bc2b2665213c44513b9ef493cf90
7
+ data.tar.gz: eb86020139c4e892f289f70a5eb9dfa15b8f2daee955d67ff16a3d93e6eab57e2847eac54f57545b9430b6c6373185fdf485c6fe726831d63b24c5e982b4931c
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,57 @@ 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/document_filter'
65
+ require_relative 'yoti/doc_scan/session/create/document_restrictions_filter'
66
+ require_relative 'yoti/doc_scan/session/create/orthogonal_restrictions_filter'
67
+ require_relative 'yoti/doc_scan/session/create/required_document'
68
+ require_relative 'yoti/doc_scan/session/create/required_id_document'
69
+ require_relative 'yoti/doc_scan/session/create/sdk_config'
70
+ require_relative 'yoti/doc_scan/session/create/notification_config'
71
+ require_relative 'yoti/doc_scan/session/create/session_specification'
72
+
73
+ require_relative 'yoti/doc_scan/session/retrieve/check_response'
74
+ require_relative 'yoti/doc_scan/session/retrieve/resource_response'
75
+ require_relative 'yoti/doc_scan/session/retrieve/authenticity_check_response'
76
+ require_relative 'yoti/doc_scan/session/retrieve/id_document_comparison_check_response'
77
+ require_relative 'yoti/doc_scan/session/retrieve/breakdown_response'
78
+ require_relative 'yoti/doc_scan/session/retrieve/details_response'
79
+ require_relative 'yoti/doc_scan/session/retrieve/document_fields_response'
80
+ require_relative 'yoti/doc_scan/session/retrieve/document_id_photo_response'
81
+ require_relative 'yoti/doc_scan/session/retrieve/face_map_response'
82
+ require_relative 'yoti/doc_scan/session/retrieve/face_match_check_response'
83
+ require_relative 'yoti/doc_scan/session/retrieve/frame_response'
84
+ require_relative 'yoti/doc_scan/session/retrieve/generated_check_response'
85
+ require_relative 'yoti/doc_scan/session/retrieve/generated_media'
86
+ require_relative 'yoti/doc_scan/session/retrieve/generated_text_data_check_response'
87
+ require_relative 'yoti/doc_scan/session/retrieve/get_session_result'
88
+ require_relative 'yoti/doc_scan/session/retrieve/id_document_resource_response'
89
+ require_relative 'yoti/doc_scan/session/retrieve/liveness_check_response'
90
+ require_relative 'yoti/doc_scan/session/retrieve/liveness_resource_response'
91
+ require_relative 'yoti/doc_scan/session/retrieve/media_response'
92
+ require_relative 'yoti/doc_scan/session/retrieve/page_response'
93
+ require_relative 'yoti/doc_scan/session/retrieve/recommendation_response'
94
+ require_relative 'yoti/doc_scan/session/retrieve/report_response'
95
+ require_relative 'yoti/doc_scan/session/retrieve/resource_container'
96
+ require_relative 'yoti/doc_scan/session/retrieve/task_response'
97
+ require_relative 'yoti/doc_scan/session/retrieve/text_data_check_response'
98
+ require_relative 'yoti/doc_scan/session/retrieve/text_extraction_task_response'
99
+ require_relative 'yoti/doc_scan/session/retrieve/zoom_liveness_resource_response'
100
+
101
+ require_relative 'yoti/doc_scan/support/supported_documents'
102
+
50
103
  # The main module namespace of the Yoti gem
51
104
  module Yoti
52
105
  class << self
@@ -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
@@ -3,7 +3,7 @@ module Yoti
3
3
  attr_accessor :client_sdk_id, :key_file_path, :key, :sdk_identifier,
4
4
  :api_url, :api_port, :api_version
5
5
 
6
- attr_writer :api_endpoint
6
+ attr_writer :api_endpoint, :doc_scan_api_endpoint
7
7
 
8
8
  # Set config variables by using a configuration block
9
9
  def initialize
@@ -18,7 +18,12 @@ module Yoti
18
18
 
19
19
  # @return [String] the API endpoint for the selected API version
20
20
  def api_endpoint
21
- @api_endpoint ||= "#{@api_url}/api/#{@api_version}"
21
+ @api_endpoint ||= ENV['YOTI_API_URL'] || "#{@api_url}/api/#{@api_version}"
22
+ end
23
+
24
+ # @return [String] the Doc Scan API endpoint
25
+ def doc_scan_api_endpoint
26
+ @doc_scan_api_endpoint ||= ENV['YOTI_DOC_SCAN_API_URL'] || "#{@api_url}/idverify/#{@api_version}"
22
27
  end
23
28
 
24
29
  # Validates the configuration values set in instance variables
@@ -37,7 +37,7 @@ module Yoti
37
37
  attr_reader :age
38
38
 
39
39
  #
40
- # @param [Yoti::Attribute]
40
+ # @param [Yoti::Attribute] attribute
41
41
  #
42
42
  def initialize(attribute)
43
43
  raise(ArgumentError, "'#{attribute.name}' is not a valid age verification") unless /^[^:]+:(?!.*:)[0-9]+$/.match?(attribute.name)
@@ -37,7 +37,7 @@ module Yoti
37
37
  #
38
38
  # @param [String] name
39
39
  #
40
- # @returns [Array]
40
+ # @return [Array]
41
41
  #
42
42
  def find_attributes_starting_with(name)
43
43
  @attributes.select { |key| key.to_s.start_with?(name) }