selfsdk 0.0.150 → 0.0.155
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.
- checksums.yaml +4 -4
- data/lib/messages/authentication_resp.rb +1 -1
- data/lib/messages/base.rb +3 -3
- data/lib/messages/fact_request.rb +1 -0
- data/lib/messages/fact_response.rb +1 -1
- data/lib/selfsdk.rb +3 -3
- data/lib/services/facts.rb +2 -2
- data/lib/sources.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e392ef3787bd32981273e008ba7e111e90432a639d6bdfa6183537ffc7bf54e
|
4
|
+
data.tar.gz: 8416b8046e8b0d82d0b20df66e88948914800dabd708ab0baee028c7c202e42a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b9f14d63812415c0769c9e3664199b64478772e7a059f0479b47047b5ac0728dbfe05533a2181c497a1e35059f1ee94d129be148e1ccc156f14ae25d5f99cf3
|
7
|
+
data.tar.gz: 5a8b438a22a9f2af22616c7294513fafd19e53c38a42b29d6f0dcc0008819fdb3adac8b4ac81c015cb0286596f901f07961e1a031402a95f94aa6bb805f34efb
|
data/lib/messages/base.rb
CHANGED
@@ -21,9 +21,9 @@ module SelfSDK
|
|
21
21
|
msgs = []
|
22
22
|
devices.each do |d|
|
23
23
|
msgs << proto(d)
|
24
|
+
SelfSDK.logger.info "synchronously messaging to #{@to}:#{d}"
|
24
25
|
end
|
25
26
|
res = @messaging.send_and_wait_for_response(msgs, self)
|
26
|
-
SelfSDK.logger.info "synchronously messaging to #{@to}:#{@d}"
|
27
27
|
res
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,7 @@ module SelfSDK
|
|
32
32
|
res = []
|
33
33
|
devices.each do |d|
|
34
34
|
res << @messaging.send_message(proto(d))
|
35
|
-
SelfSDK.logger.info "asynchronously requested information to #{@to}:#{
|
35
|
+
SelfSDK.logger.info "asynchronously requested information to #{@to}:#{d}"
|
36
36
|
end
|
37
37
|
res.first
|
38
38
|
end
|
@@ -72,7 +72,7 @@ module SelfSDK
|
|
72
72
|
|
73
73
|
protected
|
74
74
|
|
75
|
-
def proto
|
75
|
+
def proto(to_device)
|
76
76
|
raise ::StandardError.new("must define this method")
|
77
77
|
end
|
78
78
|
|
data/lib/selfsdk.rb
CHANGED
@@ -40,13 +40,13 @@ module SelfSDK
|
|
40
40
|
# @param app_id [string] the app id.
|
41
41
|
# @param app_key [string] the app api key provided by developer portal.
|
42
42
|
# @param storage_key [string] the key to be used to encrypt persisted data.
|
43
|
+
# @param storage_dir [String] The folder where encryption sessions and settings will be stored
|
43
44
|
# @param [Hash] opts the options to authenticate.
|
44
45
|
# @option opts [String] :base_url The self provider url.
|
45
46
|
# @option opts [String] :messaging_url The messaging self provider url.
|
46
47
|
# @option opts [Bool] :auto_reconnect Automatically reconnects to websocket if connection is lost (defaults to true).
|
47
48
|
# @option opts [Symbol] :env The environment to be used, defaults to ":production".
|
48
|
-
|
49
|
-
def initialize(app_id, app_key, storage_key, opts = {})
|
49
|
+
def initialize(app_id, app_key, storage_key, storage_dir, opts = {})
|
50
50
|
SelfSDK.logger.debug "syncing ntp times #{SelfSDK::Time.now}"
|
51
51
|
env = opts.fetch(:env, "")
|
52
52
|
|
@@ -56,7 +56,7 @@ module SelfSDK
|
|
56
56
|
@messaging_client = MessagingClient.new(messaging_url,
|
57
57
|
@client,
|
58
58
|
storage_key,
|
59
|
-
storage_dir:
|
59
|
+
storage_dir: storage_dir,
|
60
60
|
auto_reconnect: opts.fetch(:auto_reconnect, MessagingClient::DEFAULT_AUTO_RECONNECT),
|
61
61
|
device_id: opts.fetch(:device_id, MessagingClient::DEFAULT_DEVICE))
|
62
62
|
end
|
data/lib/services/facts.rb
CHANGED
@@ -150,7 +150,7 @@ module SelfSDK
|
|
150
150
|
raise 'provided fact does not specify a name' if f[:fact].empty?
|
151
151
|
return unless f.has_key? :sources
|
152
152
|
|
153
|
-
valid_sources = [SOURCE_USER_SPECIFIED, SOURCE_PASSPORT, SOURCE_DRIVING_LICENSE,
|
153
|
+
valid_sources = [SOURCE_USER_SPECIFIED, SOURCE_PASSPORT, SOURCE_DRIVING_LICENSE, SOURCE_IDENTITY_CARD]
|
154
154
|
factsForPassport = [ FACT_DOCUMENT_NUMBER,
|
155
155
|
FACT_SURNAME,
|
156
156
|
FACT_GIVEN_NAMES,
|
@@ -179,7 +179,7 @@ module SelfSDK
|
|
179
179
|
f[:sources].each do |s|
|
180
180
|
raise errInvalidSource unless valid_sources.include? s.to_s
|
181
181
|
|
182
|
-
if s.to_s == SOURCE_PASSPORT || s.to_s ==
|
182
|
+
if s.to_s == SOURCE_PASSPORT || s.to_s == SOURCE_IDENTITY_CARD
|
183
183
|
raise errInvalidFactToSource unless factsForPassport.include? f[:fact]
|
184
184
|
end
|
185
185
|
|
data/lib/sources.rb
CHANGED
@@ -26,7 +26,7 @@ module SelfSDK
|
|
26
26
|
SOURCE_USER_SPECIFIED = "user_specified"
|
27
27
|
SOURCE_PASSPORT = "passport"
|
28
28
|
SOURCE_DRIVING_LICENSE = "driving_license"
|
29
|
-
|
29
|
+
SOURCE_IDENTITY_CARD = "identity_card"
|
30
30
|
|
31
31
|
class << self
|
32
32
|
def message_type(s)
|
@@ -62,7 +62,12 @@ module SelfSDK
|
|
62
62
|
place_of_birth: FACT_PLACE_OF_BIRTH,
|
63
63
|
date_of_birth: FACT_DATE_OF_BIRTH,
|
64
64
|
date_of_issuance: FACT_DATE_OF_ISSUANCE,
|
65
|
-
date_of_expiration: FACT_DATE_OF_EXPIRATION
|
65
|
+
date_of_expiration: FACT_DATE_OF_EXPIRATION,
|
66
|
+
valid_from: FACT_VALID_FROM,
|
67
|
+
valid_to: FACT_VALID_TO,
|
68
|
+
categories: FACT_CATEGORIES,
|
69
|
+
sort_code: FACT_SORT_CODE,
|
70
|
+
country_of_issuance: FACT_COUNTRY_OF_ISSUANCE }
|
66
71
|
get(facts, input, "fact")
|
67
72
|
end
|
68
73
|
|
@@ -70,7 +75,7 @@ module SelfSDK
|
|
70
75
|
sources = { user_specified: SOURCE_USER_SPECIFIED,
|
71
76
|
passport: SOURCE_PASSPORT,
|
72
77
|
driving_license: SOURCE_DRIVING_LICENSE,
|
73
|
-
|
78
|
+
identity_card: SOURCE_IDENTITY_CARD }
|
74
79
|
get(sources, input, "source")
|
75
80
|
end
|
76
81
|
|