superbot-teleport 0.3.2 → 0.3.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/superbot/teleport/cli/root_command.rb +4 -2
- data/lib/superbot/teleport/version.rb +1 -1
- data/lib/superbot/teleport/web.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 460516238c53716d903af8436e2e442f8f52f3840af2af2f888bf8b0ffaaa9f7
|
4
|
+
data.tar.gz: 9abe7372a22813a125c7ba96bddbe883ef7e1f98e0ae28ab0024467fe95291f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df098d2b7632447d0337755e686db56d67289e241c24e50ada2a12665c70f5cac6db533a0e5932d7ba9f975b2ef118c7dfc37a490a1415711541d242ccec9d97
|
7
|
+
data.tar.gz: 5bf5b7f9164a5c25e3b13795500a55f2d75450285003205b1ae91feca10439cbbd7ed12738f7517e2c684b473c2bf80892974cdf7c6e9b0da627e286f027ec00
|
data/Gemfile.lock
CHANGED
@@ -18,9 +18,10 @@ module Superbot
|
|
18
18
|
option ['--org'], "ORGANIZATION", "Name of organization to take action on", environment_variable: "SUPERBOT_ORG", attribute_name: :organization, default: Superbot::Cloud.credentials&.fetch(:organization, nil)
|
19
19
|
|
20
20
|
option ['--ignore-delete'], :flag, "Reuse existing session"
|
21
|
-
option ['--keep-session'], :flag, "Keep session
|
21
|
+
option ['--keep-session'], :flag, "Keep session after teleport is closed"
|
22
22
|
option ['--session'], 'SESSION', "Session to use in teleport"
|
23
23
|
option ['--base-url'], 'BASE_URL', "Base project URL"
|
24
|
+
option ['--source'], 'SOURCE', environment_variable: "SUPERBOT_SOURCE"
|
24
25
|
|
25
26
|
def execute
|
26
27
|
validate_teleport_options(browser, organization, session)
|
@@ -38,7 +39,8 @@ module Superbot
|
|
38
39
|
ignore_delete: session || ignore_delete?,
|
39
40
|
keep_session: session || keep_session?,
|
40
41
|
session: session,
|
41
|
-
base_url: base_url
|
42
|
+
base_url: base_url,
|
43
|
+
source: source
|
42
44
|
)
|
43
45
|
|
44
46
|
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
|
@@ -61,10 +61,11 @@ module Superbot
|
|
61
61
|
|
62
62
|
parsed_body['organization_name'] = settings.teleport_options[:organization]
|
63
63
|
|
64
|
-
if settings.teleport_options[:region]
|
64
|
+
if settings.teleport_options[:region] || settings.teleport_options[:source]
|
65
65
|
parsed_body['desiredCapabilities'] ||= {}
|
66
66
|
parsed_body['desiredCapabilities']['superOptions'] ||= {}
|
67
67
|
parsed_body['desiredCapabilities']['superOptions']['region'] ||= settings.teleport_options[:region]
|
68
|
+
parsed_body['desiredCapabilities']['superOptions']['source'] ||= settings.teleport_options[:source]
|
68
69
|
end
|
69
70
|
|
70
71
|
session_response = proxy(
|
@@ -81,12 +82,13 @@ module Superbot
|
|
81
82
|
respond session_response
|
82
83
|
end
|
83
84
|
else
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
parsed_body =
|
85
|
+
parsed_body = safe_parse_json request.body, on_error: {}
|
86
|
+
|
87
|
+
if settings.teleport_options[:base_url] && parsed_body['url']
|
88
|
+
parsed_body['url'] = URI.join(settings.teleport_options[:base_url], parsed_body['url']).to_s
|
88
89
|
end
|
89
|
-
|
90
|
+
|
91
|
+
respond proxy(:post, params, headers: headers, body: parsed_body.to_json)
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|