yoti 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CONTRIBUTING.md +0 -1
- data/README.md +60 -24
- data/lib/yoti.rb +10 -1
- data/lib/yoti/activity_details.rb +18 -3
- data/lib/yoti/data_type/anchor.rb +13 -0
- data/lib/yoti/data_type/attribute.rb +25 -0
- data/lib/yoti/data_type/profile.rb +77 -0
- data/lib/yoti/data_type/signed_time_stamp.rb +11 -0
- data/lib/yoti/errors.rb +3 -0
- data/lib/yoti/protobuf/{v1/definitions/attribute-public-api/attrpubapi_v1 → definitions/attrpubapi}/attribute.proto +11 -11
- data/lib/yoti/protobuf/{v1/definitions/attribute-public-api/attrpubapi_v1 → definitions/attrpubapi}/list.proto +6 -6
- data/lib/yoti/protobuf/definitions/attrpubapi/signing.proto +23 -0
- data/lib/yoti/protobuf/{v1/definitions/common-public-api/compubapi_v1 → definitions/compubapi}/encrypted_data.proto +5 -5
- data/lib/yoti/protobuf/definitions/compubapi/signed_time_stamp.proto +43 -0
- data/lib/yoti/protobuf/{v1/protobuf.rb → main.rb} +16 -13
- data/lib/yoti/protobuf/v3/attrpubapi/attribute_pb.rb +39 -0
- data/lib/yoti/protobuf/v3/attrpubapi/list_pb.rb +28 -0
- data/lib/yoti/protobuf/v3/attrpubapi/signing_pb.rb +24 -0
- data/lib/yoti/protobuf/v3/compubapi/encrypted_data_pb.rb +19 -0
- data/lib/yoti/protobuf/v3/compubapi/signed_time_stamp_pb.rb +23 -0
- data/lib/yoti/util/age_processor.rb +11 -0
- data/lib/yoti/util/anchor_processor.rb +100 -0
- data/lib/yoti/version.rb +1 -1
- data/yoti.gemspec +2 -1
- metadata +35 -14
- data/CHANGELOG.md +0 -40
- data/lib/yoti/protobuf/v1/attribute_public_api/attribute.pb.rb +0 -45
- data/lib/yoti/protobuf/v1/attribute_public_api/list.pb.rb +0 -33
- data/lib/yoti/protobuf/v1/attribute_public_api/signing.pb.rb +0 -27
- data/lib/yoti/protobuf/v1/common_public_api/encrypted_data.pb.rb +0 -22
- data/lib/yoti/protobuf/v1/definitions/attribute-public-api/attrpubapi_v1/signing.proto +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0d128d9ffcee98658286382a901ee16fe544be243b1e7907acf2bc439238881b
|
4
|
+
data.tar.gz: 476f3130e46d8aa61084b838bafc112d8986ff65b35e9cc9cacef1321355ffdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b896c3b2e481570dc3eef74ccf2fe22b24aab97e36f7b4f1896d8336227f4ca6b248e3dc6577dda89870415128a69fed32dc83a770857b3d0c93e48ead3dd138
|
7
|
+
data.tar.gz: 1d67d39257f8c6752ee3d8c957293e082a2d2b9d57b343ef93c863b38767e412a82ebbbb3f777a6d13367aeb7d019c960ff1ee277c04d6d6b838eb3872e5ebd1
|
data/CONTRIBUTING.md
CHANGED
@@ -99,7 +99,6 @@ Commit messages should ideally start with one of the following verbs:
|
|
99
99
|
|
100
100
|
## Publishing a new release
|
101
101
|
|
102
|
-
* Update the [changelog](CHANGELOG.md) and the [lib/yoti/version.rb](lib/yoti/version.rb) file
|
103
102
|
* Create a new release on [GitHub](https://github.com/getyoti/yoti-ruby-sdk/releases)
|
104
103
|
* Build the gem and push it to [RubyGems](https://rubygems.org/gems/yoti)
|
105
104
|
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Welcome to the Yoti Ruby SDK. This repository contains the tools you need to qui
|
|
8
8
|
1. [Requirements](#requirements) - Everything you need to get started
|
9
9
|
1. [Installing the SDK](#installing-the-sdk) - How to install our SDK
|
10
10
|
1. [Configuration](#configuration) - Configuring the SDK
|
11
|
-
1. [Profile Retrieval](#profile-retrieval) - How to retrieve a Yoti profile using the token
|
11
|
+
1. [Profile Retrieval](#profile-retrieval) - How to retrieve a Yoti profile using the one time use token
|
12
12
|
1. [AML Integration](#aml-integration) - How to integrate with Yoti's AML (Anti Money Laundering) service
|
13
13
|
1. [Running the Examples](#running-the-examples) - How to run the example projects provided
|
14
14
|
1. [API Coverage](#api-coverage) - Attributes defined
|
@@ -17,7 +17,7 @@ Welcome to the Yoti Ruby SDK. This repository contains the tools you need to qui
|
|
17
17
|
## An Architectural view
|
18
18
|
|
19
19
|
To integrate your application with Yoti, your back-end must expose a GET endpoint that Yoti will use to forward tokens.
|
20
|
-
The endpoint
|
20
|
+
The endpoint is configured in the [Yoti Dashboard](https://www.yoti.com/dashboard) where you create/update your application. To see an example of how this is configured, see the [Running the Examples](#running-the-examples) section.
|
21
21
|
|
22
22
|
The image below shows how your application back-end and Yoti integrate into the context of a Login flow.
|
23
23
|
Yoti SDK carries out for you steps 6, 7, 8 and the profile decryption in step 9.
|
@@ -40,7 +40,7 @@ Yoti also allows you to enable user details verification from your mobile app by
|
|
40
40
|
|
41
41
|
## Requirements
|
42
42
|
|
43
|
-
The Yoti gem requires at least Ruby 2.
|
43
|
+
The Yoti gem requires at least Ruby `2.4.0`.
|
44
44
|
If you're using a version of Ruby lower than 2.2.2 you might encounter issues when [Bundler][] tries to install the [Active Support][] gem. This can be avoided by manually requiring activesupport 4.2.
|
45
45
|
|
46
46
|
```ruby
|
@@ -140,23 +140,26 @@ heroku config:add YOTI_KEY ="$(cat your-access-security.pem)"
|
|
140
140
|
|
141
141
|
## Profile Retrieval
|
142
142
|
|
143
|
-
When your application receives a token via the exposed endpoint (it will be assigned to a query string parameter named `token`), you can easily retrieve the user profile:
|
143
|
+
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:
|
144
144
|
|
145
145
|
```ruby
|
146
|
-
|
146
|
+
one_time_use_token = params[:token]
|
147
|
+
yoti_activity_details = Yoti::Client.get_activity_details(one_time_use_token)
|
147
148
|
```
|
148
149
|
|
149
150
|
Before you inspect the user profile, you might want to check whether the user validation was successful. This is done as follows:
|
150
151
|
|
151
152
|
```ruby
|
152
153
|
if yoti_activity_details.outcome == 'SUCCESS'
|
153
|
-
|
154
|
+
profile = yoti_activity_details.profile
|
155
|
+
given_names = profile.given_names.value
|
156
|
+
family_name = profile.family_name.value
|
154
157
|
else
|
155
158
|
# handle unhappy path
|
156
159
|
end
|
157
160
|
```
|
158
161
|
|
159
|
-
The `
|
162
|
+
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 Dashboard.
|
160
163
|
|
161
164
|
### Handling Users
|
162
165
|
|
@@ -168,11 +171,16 @@ Here is an example of how this works:
|
|
168
171
|
```ruby
|
169
172
|
if yoti_activity_details.outcome == 'SUCCESS'
|
170
173
|
user = your_user_search_function(yoti_activity_details.user_id)
|
174
|
+
profile = yoti_activity_details.profile
|
171
175
|
|
172
176
|
if user
|
173
177
|
# handle login
|
178
|
+
email = profile.email_address.value
|
174
179
|
else
|
175
180
|
# handle registration
|
181
|
+
given_names = profile.given_names.value
|
182
|
+
family_name = profile.family_name.value
|
183
|
+
email = profile.email_address.value
|
176
184
|
end
|
177
185
|
else
|
178
186
|
# handle unhappy path
|
@@ -181,6 +189,30 @@ end
|
|
181
189
|
|
182
190
|
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.
|
183
191
|
|
192
|
+
You can retrieve the sources and verifiers for each attribute as follows:
|
193
|
+
|
194
|
+
```ruby
|
195
|
+
given_names_sources = profile.given_names.sources // list of anchors
|
196
|
+
given_names_verifiers = profile.given_names.verifiers // list of anchors
|
197
|
+
```
|
198
|
+
You can also retrieve further properties from these respective anchors in the following way:
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
// Retrieving properties of the first anchor
|
202
|
+
value = given_names_sources[0].value // string
|
203
|
+
sub_type = given_names_sources[0].sub_type // string
|
204
|
+
time_stamp = given_names_sources[0].signed_time_stamp.time_stamp // DateTime object
|
205
|
+
origin_server_certs = given_names_sources[0].origin_server_certs // list of X509 certificates
|
206
|
+
```
|
207
|
+
|
208
|
+
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:
|
209
|
+
|
210
|
+
```ruby
|
211
|
+
age_attribute = profile.get_attribute('age_over:18')
|
212
|
+
sources = age_attribute.sources
|
213
|
+
verifiers = age_attribute.verifiers
|
214
|
+
```
|
215
|
+
|
184
216
|
## AML Integration
|
185
217
|
|
186
218
|
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.
|
@@ -191,7 +223,7 @@ Yoti will provide a boolean result on the following checks:
|
|
191
223
|
* Fraud list - Verify against US Social Security Administration Fraud (SSN Fraud) list
|
192
224
|
* Watch list - Verify against watch lists from the Office of Foreign Assets Control
|
193
225
|
|
194
|
-
To use this functionality you must ensure your application is assigned to your organisation in the Yoti Dashboard - please see here for further information.
|
226
|
+
To use this functionality you must ensure your application is assigned to your organisation in the Yoti Dashboard - please see [here](https://www.yoti.com/developers/documentation/#1-creating-an-organisation) for further information.
|
195
227
|
|
196
228
|
For the AML check you will need to provide the following:
|
197
229
|
|
@@ -228,26 +260,31 @@ puts Yoti::Client.aml_check(aml_profile)
|
|
228
260
|
|
229
261
|
## Running the Examples
|
230
262
|
|
231
|
-
The examples can be found in the [examples folder](examples).
|
232
|
-
For them to work you will need a working callback URL that your browser can redirect to. The callback URL for both examples will be: `http://your-local-url.domain/profile`.
|
233
|
-
|
234
|
-
The examples also use the `YOTI_APPLICATION_ID` environment variable to display the Yoti Connect button. This value can be found in your Yoti account, on the *Keys* settings page.
|
263
|
+
The examples can be found in the [examples folder](examples).
|
235
264
|
|
236
265
|
### Ruby on Rails
|
237
266
|
|
238
|
-
|
239
|
-
|
240
|
-
|
267
|
+
1. Create your application in the [Yoti Dashboard](https://www.yoti.com/dashboard/applications)
|
268
|
+
1. Set the application domain of your app to `localhost:3000`
|
269
|
+
1. Set the scenario callback URL to `/profile`
|
270
|
+
1. Rename the [.env.example](examples/rails/.env.example) file to `.env`
|
271
|
+
1. Fill in the environment variables in this file with the ones specific to your application (mentioned in the [Configuration](#configuration) section)
|
272
|
+
1. Install the dependencies with `bundle install`
|
273
|
+
1. Start the server `rails server`
|
241
274
|
|
242
|
-
Visiting
|
275
|
+
Visiting `http://localhost:3000/` should show a Yoti Connect button
|
243
276
|
|
244
277
|
### Sinatra
|
245
278
|
|
246
|
-
|
247
|
-
|
248
|
-
|
279
|
+
1. Create your application in the [Yoti Dashboard](https://www.yoti.com/dashboard/applications)
|
280
|
+
1. Set the application domain of your app to `localhost:4567`
|
281
|
+
1. Set the scenario callback URL to `/profile`
|
282
|
+
1. Rename the [.env.example](examples/sinatra/.env.example) file to `.env`
|
283
|
+
1. Fill in the environment variables in this file with the ones specific to your application (mentioned in the [Configuration](#configuration) section)
|
284
|
+
1. Install the dependencies with `bundle install`
|
285
|
+
1. Start the server `ruby ./app.rb`
|
249
286
|
|
250
|
-
Visiting
|
287
|
+
Visiting `http://localhost:4567/` should show a Yoti Connect button
|
251
288
|
|
252
289
|
### AML Check
|
253
290
|
|
@@ -259,7 +296,9 @@ Visiting the `http://your-local-url.domain` should show a Yoti Connect button
|
|
259
296
|
|
260
297
|
* Activity Details
|
261
298
|
* [X] User ID `user_id`
|
262
|
-
* [X]
|
299
|
+
* [X] Base64 Selfie URI `base64_selfie_uri`
|
300
|
+
* [X] Age verified `age_verified`
|
301
|
+
* [X] Profile `profile`
|
263
302
|
* [X] Selfie `selfie`
|
264
303
|
* [X] Full Name `full_name`
|
265
304
|
* [X] Given Names `given_names`
|
@@ -267,12 +306,9 @@ Visiting the `http://your-local-url.domain` should show a Yoti Connect button
|
|
267
306
|
* [X] Mobile Number `phone_number`
|
268
307
|
* [X] Email Address `email_address`
|
269
308
|
* [X] Age / Date of Birth `date_of_birth`
|
270
|
-
* [X] Age / Verify Condition `age_[over|under]:[1-999]`
|
271
309
|
* [X] Address `postal_address`
|
272
310
|
* [X] Gender `gender`
|
273
311
|
* [X] Nationality `nationality`
|
274
|
-
* [X] Base64 Selfie URI `base64_selfie_uri`
|
275
|
-
* [X] Age verified `age_verified`
|
276
312
|
|
277
313
|
## Support
|
278
314
|
|
data/lib/yoti.rb
CHANGED
@@ -11,9 +11,18 @@ require_relative 'yoti/http/signed_request'
|
|
11
11
|
require_relative 'yoti/http/profile_request'
|
12
12
|
require_relative 'yoti/http/request'
|
13
13
|
|
14
|
+
require_relative 'yoti/data_type/anchor'
|
15
|
+
require_relative 'yoti/data_type/profile'
|
16
|
+
require_relative 'yoti/data_type/attribute'
|
17
|
+
require_relative 'yoti/data_type/signed_time_stamp'
|
18
|
+
|
19
|
+
require_relative 'yoti/util/age_processor'
|
20
|
+
require_relative 'yoti/util/anchor_processor'
|
21
|
+
|
14
22
|
require_relative 'yoti/activity_details'
|
15
23
|
require_relative 'yoti/client'
|
16
|
-
|
24
|
+
|
25
|
+
require_relative 'yoti/protobuf/main'
|
17
26
|
|
18
27
|
# The main module namespace of the Yoti gem
|
19
28
|
module Yoti
|
@@ -23,24 +23,39 @@ module Yoti
|
|
23
23
|
def initialize(receipt, decrypted_profile = nil)
|
24
24
|
@decrypted_profile = decrypted_profile
|
25
25
|
@user_profile = {}
|
26
|
+
@extended_profile = {}
|
26
27
|
|
27
|
-
if
|
28
|
+
if @decrypted_profile.is_a?(Object) && @decrypted_profile.respond_to?(:attributes)
|
28
29
|
@decrypted_profile.attributes.each do |field|
|
29
30
|
@user_profile[field.name] = Yoti::Protobuf.value_based_on_content_type(field.value, field.content_type)
|
31
|
+
anchor_processor = Yoti::AnchorProcessor.new(field.anchors)
|
32
|
+
anchors_list = anchor_processor.process
|
30
33
|
|
31
34
|
if field.name == 'selfie'
|
32
35
|
@base64_selfie_uri = Yoti::Protobuf.image_uri_based_on_content_type(field.value, field.content_type)
|
33
36
|
end
|
34
37
|
|
35
|
-
|
36
|
-
if
|
38
|
+
|
39
|
+
if Yoti::AgeProcessor.is_age_verification(field.name)
|
37
40
|
@age_verified = field.value == 'true'
|
38
41
|
end
|
42
|
+
|
43
|
+
@extended_profile[field.name] = Yoti::Attribute.new(field.name, field.value, anchors_list['sources'], anchors_list['verifiers'])
|
39
44
|
end
|
40
45
|
end
|
41
46
|
|
42
47
|
@user_id = receipt['remember_me_id']
|
43
48
|
@outcome = receipt['sharing_outcome']
|
44
49
|
end
|
50
|
+
|
51
|
+
# @return [Hash] a JSON of the address
|
52
|
+
def structured_postal_address
|
53
|
+
@user_profile['structured_postal_address']
|
54
|
+
end
|
55
|
+
|
56
|
+
# @return [Profile] of Yoti user
|
57
|
+
def profile
|
58
|
+
return Yoti::Profile.new(@extended_profile)
|
59
|
+
end
|
45
60
|
end
|
46
61
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Yoti
|
2
|
+
# Encapsulates attribute anchor
|
3
|
+
class Anchor
|
4
|
+
attr_reader :value, :sub_type, :signed_time_stamp, :origin_server_certs
|
5
|
+
|
6
|
+
def initialize(value, sub_type, signed_time_stamp, origin_server_certs)
|
7
|
+
@value = value
|
8
|
+
@sub_type = sub_type
|
9
|
+
@signed_time_stamp = signed_time_stamp
|
10
|
+
@origin_server_certs = origin_server_certs
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Yoti
|
2
|
+
# Encapsulates profile attribute
|
3
|
+
class Attribute
|
4
|
+
FAMILY_NAME = 'family_name';
|
5
|
+
GIVEN_NAMES = 'given_names';
|
6
|
+
FULL_NAME = 'full_name';
|
7
|
+
DATE_OF_BIRTH = 'date_of_birth';
|
8
|
+
GENDER = 'gender';
|
9
|
+
NATIONALITY = 'nationality';
|
10
|
+
PHONE_NUMBER = 'phone_number';
|
11
|
+
SELFIE = 'selfie';
|
12
|
+
EMAIL_ADDRESS = 'email_address';
|
13
|
+
POSTAL_ADDRESS = 'postal_address';
|
14
|
+
STRUCTURED_POSTAL_ADDRESS = 'structured_postal_address';
|
15
|
+
|
16
|
+
attr_reader :name, :value, :sources, :verifiers
|
17
|
+
|
18
|
+
def initialize(name, value, sources, verifiers)
|
19
|
+
@name = name
|
20
|
+
@value = value
|
21
|
+
@sources = sources
|
22
|
+
@verifiers = verifiers
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Yoti
|
2
|
+
# Encapsulates Yoti user profile
|
3
|
+
class Profile
|
4
|
+
|
5
|
+
def initialize(profile_data)
|
6
|
+
if !profile_data.is_a? Object
|
7
|
+
profile_data = Hash.new
|
8
|
+
end
|
9
|
+
@profile_data = profile_data
|
10
|
+
end
|
11
|
+
|
12
|
+
def selfie
|
13
|
+
return get_attribute(Yoti::Attribute::SELFIE)
|
14
|
+
end
|
15
|
+
|
16
|
+
def family_name
|
17
|
+
return get_attribute(Yoti::Attribute::FAMILY_NAME)
|
18
|
+
end
|
19
|
+
|
20
|
+
def given_names
|
21
|
+
return get_attribute(Yoti::Attribute::GIVEN_NAMES)
|
22
|
+
end
|
23
|
+
|
24
|
+
def full_name
|
25
|
+
return get_attribute(Yoti::Attribute::FULL_NAME)
|
26
|
+
end
|
27
|
+
|
28
|
+
def phone_number
|
29
|
+
return get_attribute(Yoti::Attribute::PHONE_NUMBER)
|
30
|
+
end
|
31
|
+
|
32
|
+
def email_address
|
33
|
+
return get_attribute(Yoti::Attribute::EMAIL_ADDRESS)
|
34
|
+
end
|
35
|
+
|
36
|
+
def date_of_birth
|
37
|
+
return get_attribute(Yoti::Attribute::DATE_OF_BIRTH)
|
38
|
+
end
|
39
|
+
|
40
|
+
def gender
|
41
|
+
return get_attribute(Yoti::Attribute::GENDER)
|
42
|
+
end
|
43
|
+
|
44
|
+
def nationality
|
45
|
+
return get_attribute(Yoti::Attribute::NATIONALITY)
|
46
|
+
end
|
47
|
+
|
48
|
+
def postal_address
|
49
|
+
postal_address = get_attribute(Yoti::Attribute::POSTAL_ADDRESS)
|
50
|
+
|
51
|
+
return postal_address unless postal_address.nil?
|
52
|
+
return get_formatted_address
|
53
|
+
end
|
54
|
+
|
55
|
+
def structured_postal_address
|
56
|
+
return get_attribute(Yoti::Attribute::STRUCTURED_POSTAL_ADDRESS)
|
57
|
+
end
|
58
|
+
|
59
|
+
# @return attribute value by name
|
60
|
+
def get_attribute(attr_name)
|
61
|
+
if @profile_data.has_key? attr_name then
|
62
|
+
return @profile_data[attr_name]
|
63
|
+
end
|
64
|
+
return nil
|
65
|
+
end
|
66
|
+
|
67
|
+
protected
|
68
|
+
|
69
|
+
def get_formatted_address
|
70
|
+
full_address = structured_postal_address
|
71
|
+
if !full_address.nil? && full_address.has_key?('formatted_address')
|
72
|
+
return full_address['formatted_address']
|
73
|
+
end
|
74
|
+
return nil
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/yoti/errors.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
syntax = "proto3";
|
2
2
|
|
3
|
-
package
|
3
|
+
package Yoti.Protobuf.attrpubapi_v3;
|
4
4
|
|
5
|
-
option java_package = "com.yoti.
|
5
|
+
option java_package = "com.yoti.attrpubapi_v3";
|
6
6
|
option java_outer_classname = "AttrProto";
|
7
7
|
|
8
8
|
|
@@ -27,26 +27,26 @@ enum ContentType {
|
|
27
27
|
|
28
28
|
|
29
29
|
message Attribute {
|
30
|
-
|
30
|
+
string name = 1;
|
31
31
|
|
32
|
-
|
32
|
+
bytes value = 2;
|
33
33
|
|
34
|
-
|
34
|
+
ContentType content_type = 3;
|
35
35
|
|
36
36
|
repeated Anchor anchors = 4;
|
37
37
|
}
|
38
38
|
|
39
39
|
|
40
40
|
message Anchor {
|
41
|
-
|
41
|
+
bytes artifact_link = 1;
|
42
42
|
|
43
43
|
repeated bytes origin_server_certs = 2;
|
44
44
|
|
45
|
-
|
45
|
+
bytes artifact_signature = 3;
|
46
46
|
|
47
|
-
|
47
|
+
string sub_type = 4;
|
48
48
|
|
49
|
-
|
49
|
+
bytes signature = 5;
|
50
50
|
|
51
|
-
|
51
|
+
bytes signed_time_stamp = 6;
|
52
52
|
}
|
@@ -1,23 +1,23 @@
|
|
1
|
-
|
1
|
+
syntax = "proto3";
|
2
2
|
|
3
|
-
package
|
3
|
+
package Yoti.Protobuf.attrpubapi_v3;
|
4
4
|
|
5
5
|
import "Attribute.proto";
|
6
6
|
|
7
|
-
option java_package = "com.yoti.
|
7
|
+
option java_package = "com.yoti.attrpubapi_v3";
|
8
8
|
option java_outer_classname = "AttrProto";
|
9
9
|
|
10
10
|
|
11
11
|
// AttributeAndId is a simple container for holding an attribute's value
|
12
12
|
// alongside its ID.
|
13
13
|
message AttributeAndId {
|
14
|
-
|
14
|
+
Attribute attribute = 1;
|
15
15
|
|
16
|
-
|
16
|
+
bytes attribute_id = 2;
|
17
17
|
}
|
18
18
|
|
19
19
|
|
20
|
-
message AttributeAndIdList{
|
20
|
+
message AttributeAndIdList {
|
21
21
|
repeated AttributeAndId attribute_and_id_list = 1;
|
22
22
|
}
|
23
23
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
package Yoti.Protobuf.attrpubapi_v3;
|
4
|
+
|
5
|
+
import "Attribute.proto";
|
6
|
+
|
7
|
+
option java_package = "com.yoti.attrpubapi_v3";
|
8
|
+
option java_outer_classname = "AttrProto";
|
9
|
+
|
10
|
+
|
11
|
+
message AttributeSigning {
|
12
|
+
string name = 1;
|
13
|
+
|
14
|
+
bytes value = 2;
|
15
|
+
|
16
|
+
ContentType content_type = 3;
|
17
|
+
|
18
|
+
bytes artifact_signature = 4;
|
19
|
+
|
20
|
+
string sub_type = 5;
|
21
|
+
|
22
|
+
bytes signed_time_stamp = 6;
|
23
|
+
}
|
@@ -1,15 +1,15 @@
|
|
1
|
-
|
1
|
+
syntax = "proto3";
|
2
2
|
|
3
|
-
package
|
3
|
+
package Yoti.Protobuf.compubapi_v3;
|
4
4
|
|
5
|
-
option java_package = "com.yoti.
|
5
|
+
option java_package = "com.yoti.compubapi_v3";
|
6
6
|
option java_outer_classname = "EncryptedDataProto";
|
7
7
|
|
8
8
|
message EncryptedData {
|
9
9
|
// the iv will be used in conjunction with the secret key
|
10
10
|
// received via other channel in order to decrypt the cipher_text
|
11
|
-
|
11
|
+
bytes iv = 1;
|
12
12
|
|
13
13
|
// block of bytes to be decrypted
|
14
|
-
|
14
|
+
bytes cipher_text = 2;
|
15
15
|
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
package Yoti.Protobuf.compubapi_v3;
|
4
|
+
|
5
|
+
option java_package = "com.yoti.compubapi_v3";
|
6
|
+
option java_outer_classname = "SignedTimestampProto";
|
7
|
+
|
8
|
+
// SignedTimestamp is a timestamp associated with a message that has a
|
9
|
+
// cryptographic signature proving that it was issued by the correct authority.
|
10
|
+
message SignedTimestamp {
|
11
|
+
// Version indicates how the digests within this object are calculated.
|
12
|
+
int32 version = 1;
|
13
|
+
|
14
|
+
// Timestamp is the time this SignedTimestamp was issued. It is in UTC,
|
15
|
+
// as µseconds elapsed since the epoch (µs from 1970-01-01T00:00:00Z).
|
16
|
+
uint64 timestamp = 2;
|
17
|
+
|
18
|
+
// MessageDigest is the digest of the message this timestamp is
|
19
|
+
// associated with. The first step in verifying the timestamp is
|
20
|
+
// ensuring the MessageDigest matches the original message data.
|
21
|
+
//
|
22
|
+
// For version 1 objects, the message digest algorithm is SHA-512/224.
|
23
|
+
bytes message_digest = 3;
|
24
|
+
|
25
|
+
// ChainDigest is the digest of the previous SignedTimestamp message
|
26
|
+
// in the chain. The second step in verifying the timestamp is walking
|
27
|
+
// back over the chain and checking each SignedTimestamp's ChainDigest
|
28
|
+
// field. The SignedTimestamp at the beginning of the chain has this
|
29
|
+
// field set to a specific, publish value.
|
30
|
+
//
|
31
|
+
// For version 1 objects, the chain digest algorithm is HMAC-SHA-512/224,
|
32
|
+
// with the secret being equal to the MessageDigest field.
|
33
|
+
bytes chain_digest = 4;
|
34
|
+
|
35
|
+
// ChainDigestSkip1 is only populated once every 500 nodes. It is the
|
36
|
+
// ChainDigest value of the timestamp 500 nodes previously.
|
37
|
+
bytes chain_digest_skip1 = 5;
|
38
|
+
|
39
|
+
// ChainDigestSkip2 is only populated once every 250000 nodes (or once
|
40
|
+
// every 500 nodes that have ChainDigestSkip1 populated). It is the
|
41
|
+
// ChainDigest value of the timestamp 250000 nodes previously.
|
42
|
+
bytes chain_digest_skip2 = 6;
|
43
|
+
}
|
@@ -1,36 +1,39 @@
|
|
1
|
-
require 'protobuf'
|
2
|
-
|
3
|
-
require_relative '
|
1
|
+
require 'google/protobuf'
|
2
|
+
require 'json'
|
3
|
+
require_relative 'v3/attrpubapi/list_pb.rb'
|
4
|
+
require_relative 'v3/compubapi/encrypted_data_pb.rb'
|
5
|
+
require_relative 'v3/compubapi/signed_time_stamp_pb.rb'
|
4
6
|
|
5
7
|
module Yoti
|
6
8
|
module Protobuf
|
7
9
|
class << self
|
8
|
-
CT_UNDEFINED =
|
9
|
-
CT_STRING =
|
10
|
-
CT_JPEG =
|
11
|
-
CT_DATE =
|
12
|
-
CT_PNG =
|
10
|
+
CT_UNDEFINED = :UNDEFINED # should not be seen, and is used as an error placeholder
|
11
|
+
CT_STRING = :STRING # UTF-8 encoded text.
|
12
|
+
CT_JPEG = :JPEG # standard .jpeg image.
|
13
|
+
CT_DATE = :DATE # string in RFC3339 format (YYYY-MM-DD)
|
14
|
+
CT_PNG = :PNG # standard .png image
|
15
|
+
CT_JSON = :JSON # json_string
|
13
16
|
|
14
17
|
def current_user(receipt)
|
15
18
|
return nil unless valid_receipt?(receipt)
|
16
19
|
|
17
20
|
profile_content = receipt['other_party_profile_content']
|
18
21
|
decoded_profile_content = Base64.decode64(profile_content)
|
19
|
-
|
22
|
+
Yoti::Protobuf::CompubapiV3::EncryptedData.decode(decoded_profile_content)
|
20
23
|
end
|
21
24
|
|
22
25
|
def attribute_list(data)
|
23
|
-
|
26
|
+
Yoti::Protobuf::AttrpubapiV3::AttributeList.decode(data)
|
24
27
|
end
|
25
28
|
|
26
29
|
def value_based_on_content_type(value, content_type = nil)
|
27
30
|
case content_type
|
28
31
|
when CT_UNDEFINED
|
29
32
|
raise ProtobufError, 'The content type is invalid.'
|
30
|
-
when CT_STRING
|
31
|
-
value.encode('utf-8')
|
32
|
-
when CT_DATE
|
33
|
+
when CT_STRING, CT_DATE
|
33
34
|
value.encode('utf-8')
|
35
|
+
when CT_JSON
|
36
|
+
JSON.parse(value)
|
34
37
|
else
|
35
38
|
value
|
36
39
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: attribute.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.Attribute" do
|
8
|
+
optional :name, :string, 1
|
9
|
+
optional :value, :bytes, 2
|
10
|
+
optional :content_type, :enum, 3, "Yoti.Protobuf.attrpubapi_v3.ContentType"
|
11
|
+
repeated :anchors, :message, 4, "Yoti.Protobuf.attrpubapi_v3.Anchor"
|
12
|
+
end
|
13
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.Anchor" do
|
14
|
+
optional :artifact_link, :bytes, 1
|
15
|
+
repeated :origin_server_certs, :bytes, 2
|
16
|
+
optional :artifact_signature, :bytes, 3
|
17
|
+
optional :sub_type, :string, 4
|
18
|
+
optional :signature, :bytes, 5
|
19
|
+
optional :signed_time_stamp, :bytes, 6
|
20
|
+
end
|
21
|
+
add_enum "Yoti.Protobuf.attrpubapi_v3.ContentType" do
|
22
|
+
value :UNDEFINED, 0
|
23
|
+
value :STRING, 1
|
24
|
+
value :JPEG, 2
|
25
|
+
value :DATE, 3
|
26
|
+
value :PNG, 4
|
27
|
+
value :JSON, 5
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Yoti
|
32
|
+
module Protobuf
|
33
|
+
module AttrpubapiV3
|
34
|
+
Attribute = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.Attribute").msgclass
|
35
|
+
Anchor = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.Anchor").msgclass
|
36
|
+
ContentType = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.ContentType").enummodule
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: list.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require_relative 'Attribute_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.AttributeAndId" do
|
9
|
+
optional :attribute, :message, 1, "Yoti.Protobuf.attrpubapi_v3.Attribute"
|
10
|
+
optional :attribute_id, :bytes, 2
|
11
|
+
end
|
12
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.AttributeAndIdList" do
|
13
|
+
repeated :attribute_and_id_list, :message, 1, "Yoti.Protobuf.attrpubapi_v3.AttributeAndId"
|
14
|
+
end
|
15
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.AttributeList" do
|
16
|
+
repeated :attributes, :message, 1, "Yoti.Protobuf.attrpubapi_v3.Attribute"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module Yoti
|
21
|
+
module Protobuf
|
22
|
+
module AttrpubapiV3
|
23
|
+
AttributeAndId = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.AttributeAndId").msgclass
|
24
|
+
AttributeAndIdList = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.AttributeAndIdList").msgclass
|
25
|
+
AttributeList = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.AttributeList").msgclass
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: signing.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require_relative 'Attribute_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_message "Yoti.Protobuf.attrpubapi_v3.AttributeSigning" do
|
9
|
+
optional :name, :string, 1
|
10
|
+
optional :value, :bytes, 2
|
11
|
+
optional :content_type, :enum, 3, "Yoti.Protobuf.attrpubapi_v3.ContentType"
|
12
|
+
optional :artifact_signature, :bytes, 4
|
13
|
+
optional :sub_type, :string, 5
|
14
|
+
optional :signed_time_stamp, :bytes, 6
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Yoti
|
19
|
+
module Protobuf
|
20
|
+
module AttrpubapiV3
|
21
|
+
AttributeSigning = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.attrpubapi_v3.AttributeSigning").msgclass
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: encrypted_data.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "Yoti.Protobuf.compubapi_v3.EncryptedData" do
|
8
|
+
optional :iv, :bytes, 1
|
9
|
+
optional :cipher_text, :bytes, 2
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module Yoti
|
14
|
+
module Protobuf
|
15
|
+
module CompubapiV3
|
16
|
+
EncryptedData = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.compubapi_v3.EncryptedData").msgclass
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: signed_time_stamp.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "Yoti.Protobuf.compubapi_v3.SignedTimestamp" do
|
8
|
+
optional :version, :int32, 1
|
9
|
+
optional :timestamp, :uint64, 2
|
10
|
+
optional :message_digest, :bytes, 3
|
11
|
+
optional :chain_digest, :bytes, 4
|
12
|
+
optional :chain_digest_skip1, :bytes, 5
|
13
|
+
optional :chain_digest_skip2, :bytes, 6
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
module Yoti
|
18
|
+
module Protobuf
|
19
|
+
module CompubapiV3
|
20
|
+
SignedTimestamp = Google::Protobuf::DescriptorPool.generated_pool.lookup("Yoti.Protobuf.compubapi_v3.SignedTimestamp").msgclass
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Yoti
|
2
|
+
# Process age attribute
|
3
|
+
class AgeProcessor
|
4
|
+
AGE_PATTERN = "age_(over|under):[1-9][0-9]?[0-9]?"
|
5
|
+
|
6
|
+
# check if the key matches the format age_[over|under]:[1-999]
|
7
|
+
def self.is_age_verification(age_field)
|
8
|
+
return /#{AGE_PATTERN}/.match?(age_field)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
module Yoti
|
5
|
+
# Parse attribute anchors
|
6
|
+
class AnchorProcessor
|
7
|
+
# Define whether the search function get_anchor_value_by_oid
|
8
|
+
# should return the next value in the array
|
9
|
+
attr_reader :get_next
|
10
|
+
|
11
|
+
protected :get_next
|
12
|
+
|
13
|
+
def initialize(anchors_list)
|
14
|
+
@anchors_list = anchors_list
|
15
|
+
@get_next = false
|
16
|
+
end
|
17
|
+
|
18
|
+
def process
|
19
|
+
result_data = { "sources" => [], "verifiers" => [] }
|
20
|
+
anchor_types = self.anchor_types
|
21
|
+
|
22
|
+
@anchors_list.each do |anchor|
|
23
|
+
x509_certs_list = convert_certs_list_to_X509(anchor.origin_server_certs)
|
24
|
+
yoti_signed_time_stamp = process_signed_time_stamp(anchor.signed_time_stamp)
|
25
|
+
|
26
|
+
anchor.origin_server_certs.each do |cert|
|
27
|
+
anchor_types.each do |type, oid|
|
28
|
+
yotiAnchor = get_anchor_by_oid(cert, oid, anchor.sub_type, yoti_signed_time_stamp, x509_certs_list)
|
29
|
+
if !yotiAnchor.nil? then
|
30
|
+
result_data[type].push(yotiAnchor)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
return result_data
|
37
|
+
end
|
38
|
+
|
39
|
+
def convert_certs_list_to_X509(certs_list)
|
40
|
+
x509_certs_list = []
|
41
|
+
certs_list.each do |cert|
|
42
|
+
x509_cert = OpenSSL::X509::Certificate.new cert
|
43
|
+
x509_certs_list.push x509_cert
|
44
|
+
end
|
45
|
+
|
46
|
+
return x509_certs_list
|
47
|
+
end
|
48
|
+
|
49
|
+
def process_signed_time_stamp(signed_time_stamp_binary)
|
50
|
+
signed_time_stamp = Yoti::Protobuf::CompubapiV3::SignedTimestamp.decode(signed_time_stamp_binary)
|
51
|
+
time_in_sec = signed_time_stamp.timestamp/1000000
|
52
|
+
date_time = DateTime.parse(Time.at(time_in_sec).to_s)
|
53
|
+
return Yoti::SignedTimeStamp.new(signed_time_stamp.version, date_time)
|
54
|
+
end
|
55
|
+
|
56
|
+
def get_anchor_by_oid(cert, oid, sub_type, signed_time_stamp, x509_certs_list)
|
57
|
+
asn1Obj = OpenSSL::ASN1.decode(cert)
|
58
|
+
anchorValue = get_anchor_value_by_oid(asn1Obj, oid)
|
59
|
+
|
60
|
+
return nil unless !anchorValue.nil?
|
61
|
+
|
62
|
+
return Yoti::Anchor.new(anchorValue, sub_type, signed_time_stamp, x509_certs_list)
|
63
|
+
end
|
64
|
+
|
65
|
+
def get_anchor_value_by_oid(obj, oid)
|
66
|
+
|
67
|
+
case obj
|
68
|
+
when OpenSSL::ASN1::Sequence, Array
|
69
|
+
obj.each do |child_obj|
|
70
|
+
result = get_anchor_value_by_oid(child_obj, oid)
|
71
|
+
if result != nil
|
72
|
+
return result
|
73
|
+
end
|
74
|
+
end
|
75
|
+
when OpenSSL::ASN1::ASN1Data
|
76
|
+
if obj.value.respond_to?(:to_s) && obj.value === oid
|
77
|
+
@get_next = true
|
78
|
+
elsif obj.value.respond_to?(:to_s) && @get_next
|
79
|
+
rawValue = OpenSSL::ASN1.decode(obj.value)
|
80
|
+
anchorValue = rawValue.value[0].value
|
81
|
+
@get_next = false
|
82
|
+
return anchorValue
|
83
|
+
end
|
84
|
+
|
85
|
+
return get_anchor_value_by_oid(obj.value, oid)
|
86
|
+
else
|
87
|
+
return nil
|
88
|
+
end
|
89
|
+
|
90
|
+
# In case it's not a valid object
|
91
|
+
return nil
|
92
|
+
end
|
93
|
+
|
94
|
+
def anchor_types
|
95
|
+
return { "sources" => '1.3.6.1.4.1.47127.1.1.1',
|
96
|
+
"verifiers" => '1.3.6.1.4.1.47127.1.1.2',
|
97
|
+
}
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
data/lib/yoti/version.rb
CHANGED
data/yoti.gemspec
CHANGED
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|examples)/}) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.required_ruby_version = '>= 2'
|
24
|
+
spec.required_ruby_version = '>= 2.4'
|
25
25
|
|
26
26
|
spec.add_dependency 'protobuf', '~> 3.6'
|
27
|
+
spec.add_dependency 'google-protobuf', '~> 3.6.1'
|
27
28
|
|
28
29
|
spec.add_development_dependency 'bundler', '~> 1.13'
|
29
30
|
spec.add_development_dependency 'dotenv', '~> 2.2'
|
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.
|
4
|
+
version: 1.3.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: 2018-
|
11
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protobuf
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-protobuf
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.6.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.6.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,7 +175,6 @@ extensions: []
|
|
161
175
|
extra_rdoc_files: []
|
162
176
|
files:
|
163
177
|
- ".gitignore"
|
164
|
-
- CHANGELOG.md
|
165
178
|
- CONTRIBUTING.md
|
166
179
|
- Gemfile
|
167
180
|
- Guardfile
|
@@ -174,6 +187,10 @@ files:
|
|
174
187
|
- lib/yoti/activity_details.rb
|
175
188
|
- lib/yoti/client.rb
|
176
189
|
- lib/yoti/configuration.rb
|
190
|
+
- lib/yoti/data_type/anchor.rb
|
191
|
+
- lib/yoti/data_type/attribute.rb
|
192
|
+
- lib/yoti/data_type/profile.rb
|
193
|
+
- lib/yoti/data_type/signed_time_stamp.rb
|
177
194
|
- lib/yoti/errors.rb
|
178
195
|
- lib/yoti/http/aml_check_request.rb
|
179
196
|
- lib/yoti/http/payloads/aml_address.rb
|
@@ -181,16 +198,20 @@ files:
|
|
181
198
|
- lib/yoti/http/profile_request.rb
|
182
199
|
- lib/yoti/http/request.rb
|
183
200
|
- lib/yoti/http/signed_request.rb
|
184
|
-
- lib/yoti/protobuf/
|
185
|
-
- lib/yoti/protobuf/
|
186
|
-
- lib/yoti/protobuf/
|
187
|
-
- lib/yoti/protobuf/
|
188
|
-
- lib/yoti/protobuf/
|
189
|
-
- lib/yoti/protobuf/
|
190
|
-
- lib/yoti/protobuf/
|
191
|
-
- lib/yoti/protobuf/
|
192
|
-
- lib/yoti/protobuf/
|
201
|
+
- lib/yoti/protobuf/definitions/attrpubapi/attribute.proto
|
202
|
+
- lib/yoti/protobuf/definitions/attrpubapi/list.proto
|
203
|
+
- lib/yoti/protobuf/definitions/attrpubapi/signing.proto
|
204
|
+
- lib/yoti/protobuf/definitions/compubapi/encrypted_data.proto
|
205
|
+
- lib/yoti/protobuf/definitions/compubapi/signed_time_stamp.proto
|
206
|
+
- lib/yoti/protobuf/main.rb
|
207
|
+
- lib/yoti/protobuf/v3/attrpubapi/attribute_pb.rb
|
208
|
+
- lib/yoti/protobuf/v3/attrpubapi/list_pb.rb
|
209
|
+
- lib/yoti/protobuf/v3/attrpubapi/signing_pb.rb
|
210
|
+
- lib/yoti/protobuf/v3/compubapi/encrypted_data_pb.rb
|
211
|
+
- lib/yoti/protobuf/v3/compubapi/signed_time_stamp_pb.rb
|
193
212
|
- lib/yoti/ssl.rb
|
213
|
+
- lib/yoti/util/age_processor.rb
|
214
|
+
- lib/yoti/util/anchor_processor.rb
|
194
215
|
- lib/yoti/version.rb
|
195
216
|
- login_flow.png
|
196
217
|
- rubocop.yml
|
@@ -208,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
229
|
requirements:
|
209
230
|
- - ">="
|
210
231
|
- !ruby/object:Gem::Version
|
211
|
-
version: '2'
|
232
|
+
version: '2.4'
|
212
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
234
|
requirements:
|
214
235
|
- - ">="
|
@@ -216,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
237
|
version: '0'
|
217
238
|
requirements: []
|
218
239
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.6
|
240
|
+
rubygems_version: 2.7.6
|
220
241
|
signing_key:
|
221
242
|
specification_version: 4
|
222
243
|
summary: Yoti Ruby SDK for back-end integration.
|
data/CHANGELOG.md
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
All notable changes to this project will be documented in this file.
|
3
|
-
|
4
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
|
-
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
|
-
|
7
|
-
## 1.2.1 - 2018-03-06
|
8
|
-
### Added
|
9
|
-
- `user_profile.age_verified` helper returns a boolean value of the age validation
|
10
|
-
|
11
|
-
## 1.2.0 - 2018-02-28
|
12
|
-
### Added
|
13
|
-
- AML (Anti Money Laundering) check service
|
14
|
-
|
15
|
-
## 1.1.0 - 2017-10-24
|
16
|
-
### Changed
|
17
|
-
- `user_profile['selfie']` will return image data instead of an image URI
|
18
|
-
|
19
|
-
### Added
|
20
|
-
- `user_profile.base64_selfie_uri` helper returns the base64 selfie URI
|
21
|
-
|
22
|
-
## 1.0.3 - 2017-10-17
|
23
|
-
### Changed
|
24
|
-
- Switched from proprietary to MIT license
|
25
|
-
|
26
|
-
## 1.0.2 - 2017-03-15
|
27
|
-
### Added
|
28
|
-
- Allow empty profiles
|
29
|
-
|
30
|
-
## 1.0.1 - 2016-11-28
|
31
|
-
### Added
|
32
|
-
- Yoti proprietary license
|
33
|
-
|
34
|
-
## 1.0.0 - 2016-11-14
|
35
|
-
### Added
|
36
|
-
- This is an initial public release.
|
37
|
-
|
38
|
-
## 0.1.0 - 2016-09-14
|
39
|
-
### Added
|
40
|
-
- This is an initial private release.
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'protobuf/message'
|
2
|
-
|
3
|
-
module Yoti
|
4
|
-
module Protobuf
|
5
|
-
module V1
|
6
|
-
module Attrpubapi
|
7
|
-
##
|
8
|
-
# Enum Classes
|
9
|
-
#
|
10
|
-
class ContentType < ::Protobuf::Enum
|
11
|
-
define :UNDEFINED, 0
|
12
|
-
define :STRING, 1
|
13
|
-
define :JPEG, 2
|
14
|
-
define :DATE, 3
|
15
|
-
define :PNG, 4
|
16
|
-
end
|
17
|
-
|
18
|
-
##
|
19
|
-
# Message Classes
|
20
|
-
#
|
21
|
-
class Attribute < ::Protobuf::Message; end
|
22
|
-
class Anchor < ::Protobuf::Message; end
|
23
|
-
|
24
|
-
##
|
25
|
-
# Message Fields
|
26
|
-
#
|
27
|
-
class Attribute
|
28
|
-
optional :string, :name, 1
|
29
|
-
optional :bytes, :value, 2
|
30
|
-
optional Yoti::Protobuf::V1::Attrpubapi::ContentType, :content_type, 3
|
31
|
-
repeated Yoti::Protobuf::V1::Attrpubapi::Anchor, :anchors, 4
|
32
|
-
end
|
33
|
-
|
34
|
-
class Anchor
|
35
|
-
optional :bytes, :artifact_link, 1
|
36
|
-
repeated :bytes, :origin_server_certs, 2
|
37
|
-
optional :bytes, :artifact_signature, 3
|
38
|
-
optional :string, :sub_type, 4
|
39
|
-
optional :bytes, :signature, 5
|
40
|
-
optional :bytes, :signed_time_stamp, 6
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'protobuf/message'
|
2
|
-
require_relative 'attribute.pb'
|
3
|
-
|
4
|
-
module Yoti
|
5
|
-
module Protobuf
|
6
|
-
module V1
|
7
|
-
module Attrpubapi
|
8
|
-
##
|
9
|
-
# Message Classes
|
10
|
-
#
|
11
|
-
class AttributeAndId < ::Protobuf::Message; end
|
12
|
-
class AttributeAndIdList < ::Protobuf::Message; end
|
13
|
-
class AttributeList < ::Protobuf::Message; end
|
14
|
-
|
15
|
-
##
|
16
|
-
# Message Fields
|
17
|
-
#
|
18
|
-
class AttributeAndId
|
19
|
-
optional Yoti::Protobuf::V1::Attrpubapi::Attribute, :attribute, 1
|
20
|
-
optional :bytes, :attribute_id, 2
|
21
|
-
end
|
22
|
-
|
23
|
-
class AttributeAndIdList
|
24
|
-
repeated Yoti::Protobuf::V1::Attrpubapi::AttributeAndId, :attribute_and_id_list, 1
|
25
|
-
end
|
26
|
-
|
27
|
-
class AttributeList
|
28
|
-
repeated Yoti::Protobuf::V1::Attrpubapi::Attribute, :attributes, 1
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'protobuf/message'
|
2
|
-
require_relative 'attribute.pb'
|
3
|
-
|
4
|
-
module Yoti
|
5
|
-
module Protobuf
|
6
|
-
module V1
|
7
|
-
module Attrpubapi
|
8
|
-
##
|
9
|
-
# Message Classes
|
10
|
-
#
|
11
|
-
class AttributeSigning < ::Protobuf::Message; end
|
12
|
-
|
13
|
-
##
|
14
|
-
# Message Fields
|
15
|
-
#
|
16
|
-
class AttributeSigning
|
17
|
-
optional :string, :name, 1
|
18
|
-
optional :bytes, :value, 2
|
19
|
-
optional Yoti::Protobuf::V1::Attrpubapi::ContentType, :content_type, 3
|
20
|
-
optional :bytes, :artifact_signature, 4
|
21
|
-
optional :string, :sub_type, 5
|
22
|
-
optional :bytes, :signed_time_stamp, 6
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'protobuf/message'
|
2
|
-
|
3
|
-
module Yoti
|
4
|
-
module Protobuf
|
5
|
-
module V1
|
6
|
-
module Compubapi
|
7
|
-
##
|
8
|
-
# Message Classes
|
9
|
-
#
|
10
|
-
class EncryptedData < ::Protobuf::Message; end
|
11
|
-
|
12
|
-
##
|
13
|
-
# Message Fields
|
14
|
-
#
|
15
|
-
class EncryptedData
|
16
|
-
optional :bytes, :iv, 1
|
17
|
-
optional :bytes, :cipher_text, 2
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
//syntax = "proto2";
|
2
|
-
|
3
|
-
package attrpubapi_v1;
|
4
|
-
|
5
|
-
import "Attribute.proto";
|
6
|
-
|
7
|
-
option java_package = "com.yoti.attrpubapi_v1";
|
8
|
-
option java_outer_classname = "AttrProto";
|
9
|
-
|
10
|
-
|
11
|
-
message AttributeSigning {
|
12
|
-
optional string name = 1;
|
13
|
-
|
14
|
-
optional bytes value = 2;
|
15
|
-
|
16
|
-
optional ContentType content_type = 3;
|
17
|
-
|
18
|
-
optional bytes artifact_signature = 4;
|
19
|
-
|
20
|
-
optional string sub_type = 5;
|
21
|
-
|
22
|
-
optional bytes signed_time_stamp = 6;
|
23
|
-
}
|