selfsdk 0.0.149 → 0.0.154

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d487478c6ceb2f7fb8608d962166ff216881c4103a27f58e5af4f251546965d
4
- data.tar.gz: a6acca2829e1be56e53f254d8bee1ffb3292b8583e50bf73a1a0f2eba829cc99
3
+ metadata.gz: d9e87bb2c6abcae64f987ed167eed801384f03438e19c86ee63de4389987f8d1
4
+ data.tar.gz: 60fa41e66065e09de0c6af1adf28ebb3819a10f5baec8669d42ec518283cec2a
5
5
  SHA512:
6
- metadata.gz: cb153ee5559cac115d6d2a71d8502d82e07b8fb50207e0746c10c267be3d9accdd90a0a09e60546690315e91904bc7399e34abcb151fdcdc8415f7ada534b283
7
- data.tar.gz: f72d24cef7b29a17e2ab4dde6e636925a3163f3b8379a7ae5701d4013c448bfdb67727eba8bde49279625ea1da72e1166d9e90435898995bfdac206701331739
6
+ metadata.gz: 36d038fcbd3abc25a4e40715ec1086b30feadc64fa66989000245a7997e277dce59a6358d70fa55b4646dba6267b080f03d72ef5f07b8852dac8a0ddab249242
7
+ data.tar.gz: 4998fc609b7a11761868fcca577f974be805ca6aa45abcd70e8b6baa3cf8f4488099871877487d332fdce213fe490344aa5082dd543c05f21a67aa1278e62459
@@ -17,7 +17,7 @@ module SelfSDK
17
17
 
18
18
  protected
19
19
 
20
- def proto
20
+ def proto(to_device)
21
21
  nil
22
22
  end
23
23
  end
@@ -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}:#{@d}"
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
 
@@ -62,7 +62,7 @@ module SelfSDK
62
62
 
63
63
  protected
64
64
 
65
- def proto
65
+ def proto(to_device)
66
66
  encoded_facts = []
67
67
  @facts.each do |fact|
68
68
  encoded_facts.push(fact.to_hash)
@@ -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
- # @option opts [String] :storage_dir The folder where encryption sessions and settings will be stored
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: opts.fetch(:storage_dir, MessagingClient::DEFAULT_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
@@ -137,7 +137,7 @@ module SelfSDK
137
137
  else
138
138
  { fact: f }
139
139
  end
140
- validate_fact!(fact)
140
+ # validate_fact!(fact)
141
141
  fs << fact
142
142
  end
143
143
  fs
@@ -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, SOURCE_ID_CARD]
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,
@@ -177,18 +177,18 @@ module SelfSDK
177
177
  FACT_PHONE ]
178
178
 
179
179
  f[:sources].each do |s|
180
- raise errInvalidSource unless valid_sources.include? s
180
+ raise errInvalidSource unless valid_sources.include? s.to_s
181
181
 
182
- if s == SOURCE_PASSPORT || s == SOURCE_ID_CARD
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
 
186
- if s == SOURCE_DRIVING_LICENSE
186
+ if s.to_s == SOURCE_DRIVING_LICENSE
187
187
  raise errInvalidFactToSource unless factsForDL.include? f[:fact]
188
188
  end
189
189
 
190
- if s == SOURCE_USER_SPECIFIED
191
- raise errInvalidFactToSource unless factsForUser.include? f[:fact]
190
+ if s.to_s == SOURCE_USER_SPECIFIED
191
+ raise errInvalidFactToSource unless factsForUser.include? f[:fact].to_s
192
192
  end
193
193
  end
194
194
  end
@@ -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
- SOURCE_ID_CARD = "identity_card"
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
- id_card: SOURCE_ID_CARD }
78
+ identity_card: SOURCE_IDENTITY_CARD }
74
79
  get(sources, input, "source")
75
80
  end
76
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.149
4
+ version: 0.0.154
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldgate Ventures