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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chipfoundry-cli
3
- Version: 2.4.4
3
+ Version: 2.4.5
4
4
  Summary: CLI tool to automate ChipFoundry project submission to SFTP server
5
5
  Home-page: https://chipfoundry.io
6
6
  License: Apache-2.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
- Returns True if the key was registered successfully, False otherwise.
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
- _api_put("/users/me", {"ssh_public_key": public_key})
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():
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "chipfoundry-cli"
3
- version = "2.4.4"
3
+ version = "2.4.5"
4
4
  description = "CLI tool to automate ChipFoundry project submission to SFTP server"
5
5
  authors = ["ChipFoundry <marwan.abbas@chipfoundry.io>"]
6
6
  readme = "README.md"
File without changes