superbot-teleport 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/superbot/teleport/cli/root_command.rb +3 -1
- data/lib/superbot/teleport/version.rb +1 -1
- data/lib/superbot/teleport/web.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f14455a955fe9e85587e70aac5f615d4850b15ce26eaaa96394c6f66fdef2763
|
4
|
+
data.tar.gz: 44b3896d9971be48dd607e5ce0c7a5d2914c6da92a899deaaab610681cc57ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e5753ac512359cce5e0b511c6e1b3a24c30bc02447932cddfc29e2e7272c3920ce06f05377489ffa0a36f01542c906ae82f07e7f881bc48725c363b25c3d25d
|
7
|
+
data.tar.gz: 82c60fd35c22829c54a3ac77bacc6c321b31ed8defebfbfc85a80b3f6d15416dc379b8b682739fcfa6b3bd677d1d5995ab1fc6b46a6809e01e5f0fe5011b7ef7
|
data/Gemfile.lock
CHANGED
@@ -20,6 +20,7 @@ module Superbot
|
|
20
20
|
option ['--ignore-delete'], :flag, "Reuse existing session"
|
21
21
|
option ['--keep-session'], :flag, "Keep session when teleport closing"
|
22
22
|
option ['--session'], 'SESSION', "Session to use in teleport"
|
23
|
+
option ['--base-url'], 'BASE_URL', "Base project URL"
|
23
24
|
|
24
25
|
def execute
|
25
26
|
validate_teleport_options(browser, organization, session)
|
@@ -36,7 +37,8 @@ module Superbot
|
|
36
37
|
organization: organization,
|
37
38
|
ignore_delete: session || ignore_delete?,
|
38
39
|
keep_session: session || keep_session?,
|
39
|
-
session: session
|
40
|
+
session: session,
|
41
|
+
base_url: base_url
|
40
42
|
)
|
41
43
|
|
42
44
|
at_exit do
|
@@ -15,7 +15,7 @@ module Superbot
|
|
15
15
|
headers: { 'Authorization' => Superbot::Cloud.authorization_header },
|
16
16
|
connect_timeout: 3,
|
17
17
|
read_timeout: 500,
|
18
|
-
write_timeout: 500
|
18
|
+
write_timeout: 500,
|
19
19
|
)
|
20
20
|
|
21
21
|
sinatra.helpers do
|
@@ -35,7 +35,7 @@ module Superbot
|
|
35
35
|
path = "wd/hub/#{request_path(params)}"
|
36
36
|
headers["Content-Type"] = "application/json"
|
37
37
|
|
38
|
-
settings.connection.request({ method: method, path: path }.merge(opts))
|
38
|
+
settings.connection.request({ method: method, path: path, idempotent: true }.merge(opts))
|
39
39
|
end
|
40
40
|
|
41
41
|
def respond(upstream)
|
@@ -70,16 +70,22 @@ module Superbot
|
|
70
70
|
session_response = proxy(
|
71
71
|
:post,
|
72
72
|
params,
|
73
|
-
headers: headers,
|
73
|
+
headers: headers.merge('Idempotency-Key' => SecureRandom.hex),
|
74
74
|
body: parsed_body.to_json,
|
75
75
|
write_timeout: 500,
|
76
|
-
read_timeout: 500
|
76
|
+
read_timeout: 500,
|
77
|
+
retry_interval: 60
|
77
78
|
)
|
78
79
|
settings.teleport_options[:session] = JSON.parse(session_response.body)['sessionId']
|
79
80
|
|
80
81
|
respond session_response
|
81
82
|
end
|
82
83
|
else
|
84
|
+
base_url = settings.teleport_options[:base_url]
|
85
|
+
if base_url
|
86
|
+
# TODO parse navigation command and apply base url if set
|
87
|
+
parsed_body = safe_parse_json request.body, on_error: {}
|
88
|
+
end
|
83
89
|
respond proxy(:post, params, headers: headers, body: request.body)
|
84
90
|
end
|
85
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot-teleport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Superbot HQ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|