tinybird 0.0.1.dev55__py3-none-any.whl → 0.0.1.dev56__py3-none-any.whl
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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- tinybird/tb/__cli__.py +2 -2
- tinybird/tb/modules/login.py +19 -12
- {tinybird-0.0.1.dev55.dist-info → tinybird-0.0.1.dev56.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev55.dist-info → tinybird-0.0.1.dev56.dist-info}/RECORD +7 -7
- {tinybird-0.0.1.dev55.dist-info → tinybird-0.0.1.dev56.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev55.dist-info → tinybird-0.0.1.dev56.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev55.dist-info → tinybird-0.0.1.dev56.dist-info}/top_level.txt +0 -0
tinybird/tb/__cli__.py
CHANGED
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev56'
|
|
8
|
+
__revision__ = 'e22d9a3'
|
tinybird/tb/modules/login.py
CHANGED
|
@@ -21,11 +21,12 @@ class AuthHandler(http.server.SimpleHTTPRequestHandler):
|
|
|
21
21
|
self.send_response(200)
|
|
22
22
|
self.send_header("Content-type", "text/html")
|
|
23
23
|
self.end_headers()
|
|
24
|
-
self.wfile.write(
|
|
24
|
+
self.wfile.write(
|
|
25
|
+
"""
|
|
25
26
|
<html>
|
|
26
27
|
<head>
|
|
27
28
|
<style>
|
|
28
|
-
body {
|
|
29
|
+
body {{
|
|
29
30
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
30
31
|
background: #f5f5f5;
|
|
31
32
|
display: flex;
|
|
@@ -33,7 +34,7 @@ class AuthHandler(http.server.SimpleHTTPRequestHandler):
|
|
|
33
34
|
justify-content: center;
|
|
34
35
|
height: 100vh;
|
|
35
36
|
margin: 0;
|
|
36
|
-
}
|
|
37
|
+
}}
|
|
37
38
|
</style>
|
|
38
39
|
</head>
|
|
39
40
|
<body>
|
|
@@ -41,14 +42,16 @@ class AuthHandler(http.server.SimpleHTTPRequestHandler):
|
|
|
41
42
|
const searchParams = new URLSearchParams(window.location.search);
|
|
42
43
|
const code = searchParams.get('code');
|
|
43
44
|
const workspace = searchParams.get('workspace');
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const host = "{auth_host}";
|
|
46
|
+
fetch('/?code=' + code, {{method: 'POST'}})
|
|
47
|
+
.then(() => {{
|
|
48
|
+
window.location.href = host + "/cli-login?workspace=" + workspace;
|
|
49
|
+
}});
|
|
48
50
|
</script>
|
|
49
51
|
</body>
|
|
50
52
|
</html>
|
|
51
|
-
""")
|
|
53
|
+
""".format(auth_host=self.server.auth_host).encode()
|
|
54
|
+
)
|
|
52
55
|
|
|
53
56
|
def do_POST(self):
|
|
54
57
|
parsed_path = urllib.parse.urlparse(self.path)
|
|
@@ -75,13 +78,14 @@ AUTH_SERVER_PORT = 49160
|
|
|
75
78
|
class AuthServer(socketserver.TCPServer):
|
|
76
79
|
allow_reuse_address = True
|
|
77
80
|
|
|
78
|
-
def __init__(self, server_address, RequestHandlerClass, auth_callback):
|
|
81
|
+
def __init__(self, server_address, RequestHandlerClass, auth_callback, auth_host):
|
|
79
82
|
self.auth_callback = auth_callback
|
|
83
|
+
self.auth_host = auth_host
|
|
80
84
|
super().__init__(server_address, RequestHandlerClass)
|
|
81
85
|
|
|
82
86
|
|
|
83
|
-
def start_server(auth_callback):
|
|
84
|
-
with AuthServer(("", AUTH_SERVER_PORT), AuthHandler, auth_callback) as httpd:
|
|
87
|
+
def start_server(auth_callback, auth_host):
|
|
88
|
+
with AuthServer(("", AUTH_SERVER_PORT), AuthHandler, auth_callback, auth_host) as httpd:
|
|
85
89
|
httpd.timeout = 30
|
|
86
90
|
start_time = time.time()
|
|
87
91
|
while time.time() - start_time < 60: # Run for a maximum of 60 seconds
|
|
@@ -109,6 +113,9 @@ async def login(host: str, auth_host: str, workspace: str):
|
|
|
109
113
|
auth_event = threading.Event()
|
|
110
114
|
auth_code: list[str] = [] # Using a list to store the code, as it's mutable
|
|
111
115
|
|
|
116
|
+
if auth_host == "https://cloud.tinybird.co" and "wadus" in host:
|
|
117
|
+
auth_host = "https://cloud-wadus.tinybird.co"
|
|
118
|
+
|
|
112
119
|
def auth_callback(code):
|
|
113
120
|
auth_code.append(code)
|
|
114
121
|
auth_event.set()
|
|
@@ -116,7 +123,7 @@ async def login(host: str, auth_host: str, workspace: str):
|
|
|
116
123
|
click.echo(FeedbackManager.highlight(message="» Opening browser for authentication..."))
|
|
117
124
|
|
|
118
125
|
# Start the local server in a separate thread
|
|
119
|
-
server_thread = threading.Thread(target=start_server, args=(auth_callback,))
|
|
126
|
+
server_thread = threading.Thread(target=start_server, args=(auth_callback, auth_host))
|
|
120
127
|
server_thread.daemon = True
|
|
121
128
|
server_thread.start()
|
|
122
129
|
|
|
@@ -15,7 +15,7 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
|
15
15
|
tinybird/tornado_template.py,sha256=FL85SMPq2dH4JqKovmSbaolGdEzwOO91NqOzqXo2Qr0,41863
|
|
16
16
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
17
17
|
tinybird/ch_utils/engine.py,sha256=OXkBhlzGjZotjD0vaT-rFIbSGV4tpiHxE8qO_ip0SyQ,40454
|
|
18
|
-
tinybird/tb/__cli__.py,sha256=
|
|
18
|
+
tinybird/tb/__cli__.py,sha256=5GEuAS2TJj6qPLbuuMWnjJTIDITptpmJkpS2ZJxSBlM,251
|
|
19
19
|
tinybird/tb/cli.py,sha256=FD1pfbzu9YHJHEG6Vtn_EwPLTYhwqw-I6AxXeTaRHU8,926
|
|
20
20
|
tinybird/tb/modules/auth.py,sha256=EzRWFmwRkXNhUmRaruEVFLdkbUg8xMSix0cAWl5D4Jg,9029
|
|
21
21
|
tinybird/tb/modules/build.py,sha256=bGx4sON9g90zVBVCd16La-1yV1nWZ_AY-2RZ77sco0s,8361
|
|
@@ -36,7 +36,7 @@ tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,83
|
|
|
36
36
|
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
37
37
|
tinybird/tb/modules/local.py,sha256=_PIa-1M-72bv9rhLwqaNthJM1ZhvcjWXFChZAfEPXRs,5658
|
|
38
38
|
tinybird/tb/modules/local_common.py,sha256=W1fEnB1vBQ4YC5U1PdA0w0g3cTV78bQ5R-lRxdDj5-Y,2868
|
|
39
|
-
tinybird/tb/modules/login.py,sha256=
|
|
39
|
+
tinybird/tb/modules/login.py,sha256=_Wg2diSxyj9BCpQ_61UMAiS6YeVkOb2fnbgt5Skrveg,6047
|
|
40
40
|
tinybird/tb/modules/materialization.py,sha256=HQKRTH6lkcYiDQJihbFqF_in58ezXG4ggZ_7Ywp_nUM,5738
|
|
41
41
|
tinybird/tb/modules/mock.py,sha256=PzFtZL-6bZAZ3EiCC2nYJo058I4m50fD7FcBHISn3cI,5235
|
|
42
42
|
tinybird/tb/modules/pipe.py,sha256=pH2KwgH6Xbvl3kT8vMelpKvT6bcyB4EKFDvGfOsxXbg,2418
|
|
@@ -74,8 +74,8 @@ tinybird/tb_cli_modules/config.py,sha256=6u6B5QCdiQLbJkCkwtnKGs9H3nP-KXXhC75mF7B
|
|
|
74
74
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
75
75
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
76
76
|
tinybird/tb_cli_modules/telemetry.py,sha256=iEGnMuCuNhvF6ln__j6X9MSTwL_0Hm-GgFHHHvhfknk,10466
|
|
77
|
-
tinybird-0.0.1.
|
|
78
|
-
tinybird-0.0.1.
|
|
79
|
-
tinybird-0.0.1.
|
|
80
|
-
tinybird-0.0.1.
|
|
81
|
-
tinybird-0.0.1.
|
|
77
|
+
tinybird-0.0.1.dev56.dist-info/METADATA,sha256=BEIuDVbGT-rIUDOER7B99FXf_bjAgiL74CkedcbagLI,2482
|
|
78
|
+
tinybird-0.0.1.dev56.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
79
|
+
tinybird-0.0.1.dev56.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
80
|
+
tinybird-0.0.1.dev56.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
81
|
+
tinybird-0.0.1.dev56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|