remotivelabs-cli 0.1.0a2__py3-none-any.whl → 0.1.0a3__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.
- cli/cloud/auth/login.py +8 -9
- {remotivelabs_cli-0.1.0a2.dist-info → remotivelabs_cli-0.1.0a3.dist-info}/METADATA +1 -1
- {remotivelabs_cli-0.1.0a2.dist-info → remotivelabs_cli-0.1.0a3.dist-info}/RECORD +6 -6
- {remotivelabs_cli-0.1.0a2.dist-info → remotivelabs_cli-0.1.0a3.dist-info}/LICENSE +0 -0
- {remotivelabs_cli-0.1.0a2.dist-info → remotivelabs_cli-0.1.0a3.dist-info}/WHEEL +0 -0
- {remotivelabs_cli-0.1.0a2.dist-info → remotivelabs_cli-0.1.0a3.dist-info}/entry_points.txt +0 -0
cli/cloud/auth/login.py
CHANGED
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import base64
|
4
4
|
import hashlib
|
5
|
-
import json
|
6
5
|
import os
|
7
6
|
import secrets
|
8
7
|
import sys
|
@@ -79,6 +78,7 @@ class S(BaseHTTPRequestHandler):
|
|
79
78
|
allow_status_codes=[401, 400],
|
80
79
|
)
|
81
80
|
if res.status_code != 200:
|
81
|
+
print(res.text)
|
82
82
|
ErrorPrinter.print_generic_error(
|
83
83
|
"Failed to fetch token. Please try again, if the problem persists please reach out to support@remotivelabs.com"
|
84
84
|
)
|
@@ -145,8 +145,8 @@ def create_personal_token() -> None:
|
|
145
145
|
response = Rest.handle_post(
|
146
146
|
url="/api/me/keys",
|
147
147
|
return_response=True,
|
148
|
-
body=json.dumps({"alias": "roine"}),
|
149
148
|
access_token=short_lived_token,
|
149
|
+
# TODO - add body with alias
|
150
150
|
)
|
151
151
|
token = response.json()
|
152
152
|
email = token["account"]["email"]
|
@@ -159,7 +159,7 @@ def create_personal_token() -> None:
|
|
159
159
|
access_token=short_lived_token,
|
160
160
|
allow_status_codes=[400, 404],
|
161
161
|
)
|
162
|
-
if res is not None and res.status_code ==
|
162
|
+
if res is not None and res.status_code == 204:
|
163
163
|
Rest.handle_delete(
|
164
164
|
f"/api/me/keys/{existing_file.name}",
|
165
165
|
quiet=True,
|
@@ -244,7 +244,7 @@ def login(headless: bool = False) -> bool: # noqa: C901, PLR0912, PLR0915
|
|
244
244
|
f"&code_challenge={code_challenge}"
|
245
245
|
f"&redirect_uri=http://localhost:{httpd.server_address[1]}"
|
246
246
|
)
|
247
|
-
console.print(url, style="bold")
|
247
|
+
console.print(url, style="bold", soft_wrap=True)
|
248
248
|
httpd.serve_forever()
|
249
249
|
|
250
250
|
def login_headless() -> None:
|
@@ -261,7 +261,7 @@ def login(headless: bool = False) -> bool: # noqa: C901, PLR0912, PLR0915
|
|
261
261
|
f"&response_type=code"
|
262
262
|
f"&code_challenge={code_challenge}"
|
263
263
|
)
|
264
|
-
console.print(url, style="bold")
|
264
|
+
console.print(url, style="bold", soft_wrap=True)
|
265
265
|
|
266
266
|
code = typer.prompt(
|
267
267
|
"Once finished, enter the verification code provided in your browser",
|
@@ -301,17 +301,16 @@ def login(headless: bool = False) -> bool: # noqa: C901, PLR0912, PLR0915
|
|
301
301
|
|
302
302
|
if not could_open:
|
303
303
|
print(
|
304
|
-
"Could not open a browser on this machine, this is likely because you are in an environment where no browser is
|
304
|
+
"Could not open a browser on this machine, this is likely because you are in an environment where no browser is available"
|
305
305
|
)
|
306
306
|
print("")
|
307
307
|
if force_use_webserver_callback():
|
308
308
|
login_with_callback_but_copy_url()
|
309
|
+
create_personal_token()
|
309
310
|
else:
|
310
311
|
login_headless()
|
311
312
|
else:
|
312
313
|
httpd.serve_forever()
|
313
|
-
|
314
|
-
# Once we received our callback or code we are logged in and ready to go
|
315
|
-
create_personal_token()
|
314
|
+
create_personal_token()
|
316
315
|
|
317
316
|
return True
|
@@ -15,7 +15,7 @@ cli/broker/signals.py,sha256=MFj_bOLIxHY1v3XPkKk6n8U3JLaY8nrXHahRQaVse6s,8207
|
|
15
15
|
cli/cloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
cli/cloud/auth/__init__.py,sha256=MtQ01-n8CgZb9Y_SvxwZUgj44Yo0dFAU3_XwhQiUYtw,54
|
17
17
|
cli/cloud/auth/cmd.py,sha256=aOvbrzNb7moClgmde25T0coBs8Ge696xUB_w6qfvN8I,2920
|
18
|
-
cli/cloud/auth/login.py,sha256=
|
18
|
+
cli/cloud/auth/login.py,sha256=kaUxKfXXk392s2mMM8d-5wuhWuIqVNK6PKLSu-pxMbw,11444
|
19
19
|
cli/cloud/auth_tokens.py,sha256=XHXrCwgK_akrCbFxcxtDr7GDM9cd-T_s40PrRovY4Lk,12344
|
20
20
|
cli/cloud/brokers.py,sha256=QTA9bmaK06LKEccF6IBgWBonC4VFrKwFQBsACX_IzYw,3896
|
21
21
|
cli/cloud/cloud_cli.py,sha256=q-oiaLcKC-BRamXfIFGn-BskRmJ3utA7-tI39lSs3Cs,1309
|
@@ -52,8 +52,8 @@ cli/typer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
cli/typer/typer_utils.py,sha256=8SkvG9aKkfK9fTRsLD9pOBtWn9XSwtOXWg2RAk9FhOI,708
|
53
53
|
cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
54
54
|
cli/utils/rest_helper.py,sha256=b_FJY6MxnFSqo11qaHxkBFHfVlKf7Zj28Uxv9Oj7XY4,14141
|
55
|
-
remotivelabs_cli-0.1.
|
56
|
-
remotivelabs_cli-0.1.
|
57
|
-
remotivelabs_cli-0.1.
|
58
|
-
remotivelabs_cli-0.1.
|
59
|
-
remotivelabs_cli-0.1.
|
55
|
+
remotivelabs_cli-0.1.0a3.dist-info/LICENSE,sha256=qDPP_yfuv1fF-u7EfexN-cN3M8aFgGVndGhGLovLKz0,608
|
56
|
+
remotivelabs_cli-0.1.0a3.dist-info/METADATA,sha256=2nOuSlIEviS1n_bssUYSEKr0pbE67iJ85J2TYvwD9kI,1430
|
57
|
+
remotivelabs_cli-0.1.0a3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
58
|
+
remotivelabs_cli-0.1.0a3.dist-info/entry_points.txt,sha256=lvDhPgagLqW_KTnLPCwKSqfYlEp-1uYVosRiPjsVj10,45
|
59
|
+
remotivelabs_cli-0.1.0a3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|