selfsdk 0.0.159 → 0.0.160

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: 1a1de83ae25387f6180432dd419f36568956a458bdbfd5df988ea9292588e50a
4
- data.tar.gz: 55717411b03f983659ee503493a233d3ceea14f35fd991eec9494a6bc01fe9b2
3
+ metadata.gz: b9e34e9c7b71fd0ee4cf1c8ed30a9febf6173f32a04914e5b20f267d8fd416fa
4
+ data.tar.gz: b2965cd517a8e8d189ae5a054cb98c8d8bd2ce37d29cadf16fc6ae100e65f877
5
5
  SHA512:
6
- metadata.gz: 291ba0d883273e9aa94eb61aa936014a1fd4a6031c9e921d0affc5da4064c39a4cc5b073bb68823ae73d53a33c2808f9cb4921eeac0e043308715d8eb37b9239
7
- data.tar.gz: d73be5eb6086614300de7469026715881b640ea51fd9e9e5d8054a7b9c387b9d67f3cb21e72f358ff899833176bf9bb38962832405dd68461fc489e8d217d345
6
+ metadata.gz: bac951c530244b572a3c9ffc32da0ac19d2c5fa43f3367c161994cde6e2a476fbcd14f1c1cc9f9ca90c71037cca4082dd4a0f114b59443730f7162b3db765d0b
7
+ data.tar.gz: 041e7a4eb12edb86530d4d9c93192bd230aa620b88e8585aaf49c808b28f7f0b1d5ad176e111d0d62b0aa5a2f0b74e2cf950fd531bca82f537df26d4c077ab4e
@@ -57,6 +57,7 @@ module SelfSDK
57
57
  m.id = @id
58
58
  m.from = @to
59
59
  m.to = @from
60
+ m.sub = @to
60
61
  m.audience = @from
61
62
  m.to_device = @messaging.device_id
62
63
  m.from_device = @to_device
@@ -60,15 +60,13 @@ module SelfSDK
60
60
  end
61
61
  end
62
62
 
63
- protected
64
-
65
- def proto(to_device)
63
+ def body
66
64
  encoded_facts = []
67
65
  @facts.each do |fact|
68
66
  encoded_facts.push(fact.to_hash)
69
67
  end
70
- body = @jwt.prepare(
71
- typ: MSG_TYPE,
68
+
69
+ { typ: MSG_TYPE,
72
70
  iss: @jwt.id,
73
71
  sub: @sub || @to,
74
72
  aud: @audience,
@@ -77,15 +75,20 @@ module SelfSDK
77
75
  cid: @id,
78
76
  jti: SecureRandom.uuid,
79
77
  status: @status,
80
- facts: encoded_facts,
81
- )
78
+ facts: encoded_facts }
79
+ end
80
+
81
+ protected
82
+
83
+ def proto(to_device)
84
+
82
85
 
83
86
  Msgproto::Message.new(
84
87
  type: Msgproto::MsgType::MSG,
85
88
  id: SecureRandom.uuid,
86
89
  sender: "#{@jwt.id}:#{@messaging.device_id}",
87
90
  recipient: "#{@to}:#{@to_device}",
88
- ciphertext: encrypt_message(body, @to, @to_device)
91
+ ciphertext: encrypt_message(@jwt.prepare(body), @to, @to_device)
89
92
  )
90
93
  end
91
94
  end
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.159
4
+ version: 0.0.160
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldgate Ventures