chipfoundry-cli 2.4.4__tar.gz → 2.4.5__tar.gz
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.
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/PKG-INFO +1 -1
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/main.py +20 -3
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/pyproject.toml +1 -1
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/LICENSE +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/README.md +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/__init__.py +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/check_refs.py +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/remote_precheck_git.py +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/utils.py +0 -0
- {chipfoundry_cli-2.4.4 → chipfoundry_cli-2.4.5}/chipfoundry_cli/version_check.py +0 -0
|
@@ -205,16 +205,33 @@ def config_cmd():
|
|
|
205
205
|
def _try_register_ssh_key(public_key: str) -> bool:
|
|
206
206
|
"""Attempt to register the SSH public key on the user's platform profile.
|
|
207
207
|
|
|
208
|
-
|
|
208
|
+
Calls the CLI-specific ``PUT /auth/cli/ssh-key`` endpoint so the request
|
|
209
|
+
stays on the public API surface. Returns True on success, False otherwise.
|
|
210
|
+
Errors are swallowed silently so the caller can print the manual-registration
|
|
211
|
+
fallback without a scary ``API request failed`` line first.
|
|
209
212
|
"""
|
|
213
|
+
import httpx as _httpx
|
|
214
|
+
|
|
210
215
|
config = load_user_config()
|
|
211
216
|
if not config.get("api_key"):
|
|
212
217
|
return False
|
|
218
|
+
|
|
213
219
|
try:
|
|
214
|
-
|
|
215
|
-
return True
|
|
220
|
+
client, _ = _api_client()
|
|
216
221
|
except SystemExit:
|
|
217
222
|
return False
|
|
223
|
+
try:
|
|
224
|
+
resp = client.put("/auth/cli/ssh-key", json={"ssh_public_key": public_key})
|
|
225
|
+
if resp.status_code == 200:
|
|
226
|
+
return True
|
|
227
|
+
return False
|
|
228
|
+
except _httpx.HTTPError:
|
|
229
|
+
return False
|
|
230
|
+
finally:
|
|
231
|
+
try:
|
|
232
|
+
client.close()
|
|
233
|
+
except Exception:
|
|
234
|
+
pass
|
|
218
235
|
|
|
219
236
|
|
|
220
237
|
def _print_manual_key_instructions():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|