isomorfeus-transport 1.0.0.zeta3 → 1.0.0.zeta4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ff4b268c98842310418609fc5d66c9e35e8a2f5ce194772f75343bbf1b02da
|
4
|
+
data.tar.gz: eb829e7eb9946eb5f3f56cca385dd9d48c74af3c11bca534586050dfb6a7affe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52c37038c72374f5961e33706a9363eff09f647d0ff9b211e70b5eb3eec81a40b02322b1d30394f13c49b42d5fce16067d5806f96de387eda81a4e43ef35a278
|
7
|
+
data.tar.gz: a066cd1b269dd1f66fa12ace7e8d4c9546013c538b4d790d13b559837a865958c9afaa4e063cc61be1538cd5e0559b3855b8c88d89b68f34cf74f45196ef14be
|
@@ -19,7 +19,9 @@ module Isomorfeus
|
|
19
19
|
agent = Isomorfeus::Transport::RequestAgent.get!(agent_id)
|
20
20
|
Isomorfeus::Transport.unregister_request_in_progress(agent_id)
|
21
21
|
unless agent.promise.realized?
|
22
|
-
agent.
|
22
|
+
agent.full_response = response_hash
|
23
|
+
agent.response = response_hash[:response][:agent_ids][agent_id]
|
24
|
+
agent.promise.resolve(agent)
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
data/lib/isomorfeus/transport.rb
CHANGED
@@ -112,8 +112,8 @@ module Isomorfeus
|
|
112
112
|
raise 'No socket!' unless @socket
|
113
113
|
@socket.send(`JSON.stringify(#{{subscribe: { agent_ids: { agent.id => request }}}.to_n})`)
|
114
114
|
end
|
115
|
-
result_promise = agent.promise.then do |
|
116
|
-
response
|
115
|
+
result_promise = agent.promise.then do |agent|
|
116
|
+
agent.response
|
117
117
|
end
|
118
118
|
if block_given?
|
119
119
|
result_promise = result_promise.then do |response|
|
@@ -133,8 +133,8 @@ module Isomorfeus
|
|
133
133
|
raise 'No socket!' unless @socket
|
134
134
|
@socket.send(`JSON.stringify(#{{unsubscribe: { agent_ids: { agent.id => request }}}.to_n})`)
|
135
135
|
end
|
136
|
-
result_promise = agent.promise.then do |
|
137
|
-
response
|
136
|
+
result_promise = agent.promise.then do |agent|
|
137
|
+
agent.response
|
138
138
|
end
|
139
139
|
if block_given?
|
140
140
|
result_promise = result_promise.then do |response|
|
@@ -17,14 +17,19 @@ module LucidAuthentication
|
|
17
17
|
else
|
18
18
|
`console.warn("Connection not secure, ensure a secure connection in production, otherwise login will fail!")` unless Isomorfeus::Transport.socket.url.start_with?('wss:')
|
19
19
|
end
|
20
|
-
Isomorfeus::Transport.promise_send_path('Isomorfeus::Transport::Handler::AuthenticationHandler', 'login', user_identifier, user_password).then do |
|
21
|
-
if
|
22
|
-
|
23
|
-
class_name = response[:agent_response][:data][:nodes].keys.first
|
24
|
-
node_id = response[:agent_response][:data][:nodes][class_name].keys.first
|
25
|
-
Isomorfeus.cached_node_class(class_name).new({id: node_id})
|
20
|
+
Isomorfeus::Transport.promise_send_path('Isomorfeus::Transport::Handler::AuthenticationHandler', 'login', user_identifier, user_password).then do |agent|
|
21
|
+
if agent.processed
|
22
|
+
agent.result
|
26
23
|
else
|
27
|
-
|
24
|
+
agent.processed = true
|
25
|
+
if agent.response.key?(:success)
|
26
|
+
Isomorfeus.store.dispatch(type: 'DATA_LOAD', data: agent.response[:data])
|
27
|
+
class_name = agent.response[:data][:nodes].keys.first
|
28
|
+
node_id = agent.response[:data][:nodes][class_name].keys.first
|
29
|
+
agent.result = Isomorfeus.cached_node_class(class_name).new({id: node_id})
|
30
|
+
else
|
31
|
+
raise 'Login failed!' # calls .fail
|
32
|
+
end
|
28
33
|
end
|
29
34
|
end
|
30
35
|
end
|
@@ -36,8 +41,9 @@ module LucidAuthentication
|
|
36
41
|
end
|
37
42
|
|
38
43
|
def promise_deauthentication_with_isomorfeus
|
39
|
-
Isomorfeus::Transport.promise_send_path('Isomorfeus::Transport::Handler::AuthenticationHandler', 'logout', 'logout').then do |
|
40
|
-
|
44
|
+
Isomorfeus::Transport.promise_send_path('Isomorfeus::Transport::Handler::AuthenticationHandler', 'logout', 'logout').then do |agent|
|
45
|
+
agent.processed = true
|
46
|
+
agent.response.key?(:success) ? true : raise('Logout failed!')
|
41
47
|
end
|
42
48
|
end
|
43
49
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.zeta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 16.9.
|
89
|
+
version: 16.9.20
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 16.9.
|
96
|
+
version: 16.9.20
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: isomorfeus-policy
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.0.0.
|
103
|
+
version: 1.0.0.zeta4
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.0.0.
|
110
|
+
version: 1.0.0.zeta4
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: websocket-driver
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.0.
|
131
|
+
version: 1.0.0.zeta4
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.0.
|
138
|
+
version: 1.0.0.zeta4
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: opal-webpack-loader
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|