selfsdk 0.0.200 → 0.0.201
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messages/base.rb +4 -0
- data/lib/messages/connection_request.rb +2 -0
- data/lib/messages/fact_issue.rb +2 -0
- data/lib/messages/fact_request.rb +2 -0
- data/lib/messages/fact_response.rb +0 -13
- data/lib/messaging.rb +25 -1
- metadata +21 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cb8631899d2a3a9bcd9d3dc58171fcdd6714de37995efe2984eaa1aa823e091
|
4
|
+
data.tar.gz: f0aa18f9e3eb660e1e644b261e271e36381a67a815fea054bc1a61a5826b63d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f05d3278b9c176e19af9ee0a08e162091e67a4ea452b700f894bab0fb33c81c29748733ce0fc7052516c75eadcfd45c77dcf653ee455f7258ced4d60ed8a415
|
7
|
+
data.tar.gz: 30e56bd392849869232b1997a09d1c98fa8d2a0b825ac30f166b32c97813437d2aefc1613a1c9701ff356814dee21d8cff9668cdae7ba6baeadbbb5db41708e0
|
data/lib/messages/base.rb
CHANGED
data/lib/messages/fact_issue.rb
CHANGED
@@ -92,19 +92,6 @@ module SelfSDK
|
|
92
92
|
def auth_response?
|
93
93
|
@auth == true
|
94
94
|
end
|
95
|
-
|
96
|
-
protected
|
97
|
-
|
98
|
-
def proto(to_device)
|
99
|
-
@to_device = to_device
|
100
|
-
Msgproto::Message.new(
|
101
|
-
type: Msgproto::MsgType::MSG,
|
102
|
-
id: SecureRandom.uuid,
|
103
|
-
sender: "#{@jwt.id}:#{@messaging.device_id}",
|
104
|
-
recipient: "#{@to}:#{@to_device}",
|
105
|
-
ciphertext: encrypt_message(@jwt.prepare(body), [{id: @to, device_id: @to_device}])
|
106
|
-
)
|
107
|
-
end
|
108
95
|
end
|
109
96
|
end
|
110
97
|
end
|
data/lib/messaging.rb
CHANGED
@@ -17,6 +17,23 @@ module SelfSDK
|
|
17
17
|
DEFAULT_STORAGE_DIR="./.self_storage"
|
18
18
|
ON_DEMAND_CLOSE_CODE=3999
|
19
19
|
|
20
|
+
PRIORITIES = {
|
21
|
+
"chat.invite": SelfSDK::Messages::PRIORITY_VISIBLE,
|
22
|
+
"chat.join": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
23
|
+
"chat.message": SelfSDK::Messages::PRIORITY_VISIBLE,
|
24
|
+
"chat.message.delete": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
25
|
+
"chat.message.delivered": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
26
|
+
"chat.message.edit": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
27
|
+
"chat.message.read": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
28
|
+
"chat.remove": SelfSDK::Messages::PRIORITY_INVISIBLE,
|
29
|
+
"document.sign.req": SelfSDK::Messages::PRIORITY_VISIBLE,
|
30
|
+
"identities.authenticate.req": SelfSDK::Messages::PRIORITY_VISIBLE,
|
31
|
+
"identities.connections.req": SelfSDK::Messages::PRIORITY_VISIBLE,
|
32
|
+
"identities.facts.query.req": SelfSDK::Messages::PRIORITY_VISIBLE,
|
33
|
+
"identities.facts.issue": SelfSDK::Messages::PRIORITY_VISIBLE,
|
34
|
+
"identities.notify": SelfSDK::Messages::PRIORITY_VISIBLE
|
35
|
+
}
|
36
|
+
|
20
37
|
attr_accessor :client, :jwt, :device_id, :ack_timeout, :timeout, :type_observer, :uuid_observer, :encryption_client, :source
|
21
38
|
|
22
39
|
# RestClient initializer
|
@@ -87,7 +104,8 @@ module SelfSDK
|
|
87
104
|
m.id = SecureRandom.uuid
|
88
105
|
m.sender = "#{@jwt.id}:#{@device_id}"
|
89
106
|
m.recipient = "#{recipient}:#{recipient_device}"
|
90
|
-
|
107
|
+
m.message_type = "identities.facts.query.resp"
|
108
|
+
m.priority = select_priority(m.message_type)
|
91
109
|
m.ciphertext = @jwt.prepare(request)
|
92
110
|
|
93
111
|
send_message m
|
@@ -133,6 +151,8 @@ module SelfSDK
|
|
133
151
|
m.sender = current_device
|
134
152
|
m.recipient = "#{r[:id]}:#{r[:device_id]}"
|
135
153
|
m.ciphertext = ciphertext
|
154
|
+
m.message_type = r[:typ]
|
155
|
+
m.priority = select_priority(r[:typ])
|
136
156
|
|
137
157
|
SelfSDK.logger.info " -> to #{m.recipient}"
|
138
158
|
send_message m
|
@@ -514,5 +534,9 @@ module SelfSDK
|
|
514
534
|
end
|
515
535
|
|
516
536
|
end
|
537
|
+
|
538
|
+
def select_priority(mtype)
|
539
|
+
PRIORITIES[mtype] || SelfSDK::Messages::PRIORITY_VISIBLE
|
540
|
+
end
|
517
541
|
end
|
518
542
|
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.
|
4
|
+
version: 0.0.201
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aldgate Ventures
|
@@ -324,6 +324,26 @@ dependencies:
|
|
324
324
|
- - ">="
|
325
325
|
- !ruby/object:Gem::Version
|
326
326
|
version: '0'
|
327
|
+
- !ruby/object:Gem::Dependency
|
328
|
+
name: rexml
|
329
|
+
requirement: !ruby/object:Gem::Requirement
|
330
|
+
requirements:
|
331
|
+
- - "~>"
|
332
|
+
- !ruby/object:Gem::Version
|
333
|
+
version: '3.2'
|
334
|
+
- - ">="
|
335
|
+
- !ruby/object:Gem::Version
|
336
|
+
version: 3.2.5
|
337
|
+
type: :development
|
338
|
+
prerelease: false
|
339
|
+
version_requirements: !ruby/object:Gem::Requirement
|
340
|
+
requirements:
|
341
|
+
- - "~>"
|
342
|
+
- !ruby/object:Gem::Version
|
343
|
+
version: '3.2'
|
344
|
+
- - ">="
|
345
|
+
- !ruby/object:Gem::Version
|
346
|
+
version: 3.2.5
|
327
347
|
description:
|
328
348
|
email:
|
329
349
|
executables: []
|