Skip to content

fix(keygen): call /auth/cli/ssh-key instead of /users/me (2.4.5)#19

Merged
jeffdi merged 1 commit intomainfrom
fix/keygen-use-cli-ssh-key-endpoint
Apr 21, 2026
Merged

fix(keygen): call /auth/cli/ssh-key instead of /users/me (2.4.5)#19
jeffdi merged 1 commit intomainfrom
fix/keygen-use-cli-ssh-key-endpoint

Conversation

@jeffdi
Copy link
Copy Markdown
Contributor

@jeffdi jeffdi commented Apr 21, 2026

Summary

cf keygen attempted to auto-register the generated SSH public key via PUT /users/me, but that route isn't mounted on the public API at api.chipfoundry.io. Users saw an ugly HTTP 404: Not Found printed right above the friendly "To register this key" fallback.

  • Switches _try_register_ssh_key to call the new CLI-native endpoint PUT /api/v1/auth/cli/ssh-key on the public API (added in chipfoundry/chipignite-backend-services PR).
  • Swallows transport errors silently so the manual-registration instructions are the only thing the user sees when auto-registration is unavailable (not logged in, older backend, offline, etc.) — no more scary ✗ API request failed line preceding the fallback.
  • Bumps pyproject.toml to 2.4.5.

Test plan

  • cf keygen on a machine where the user is not logged in: prints the existing key and the manual-registration fallback, no API error line.
  • cf keygen --overwrite on a machine where the user is logged in and the backend is deployed: prints "✓ Key registered on your ChipFoundry profile. SFTP access is ready."
  • cf keygen --overwrite with a stubbed offline backend: falls back cleanly to the manual instructions without a stack trace.
  • Regression: cf push, cf whoami, cf init all still work (error handling unchanged for every other call site of _api_put).

Made with Cursor

`cf keygen` was trying to auto-register the generated SSH public key via
`PUT /users/me`, but that route is only wired on the internal backend.
Hitting api.chipfoundry.io produced an `HTTP 404: Not Found` that looked
like a CLI bug and leaked through `_api_put`'s error printer before the
friendly "To register this key" fallback, confusing users.

Switch `_try_register_ssh_key` to the new CLI-native endpoint
`PUT /api/v1/auth/cli/ssh-key` on the public API (see backend PR), and
swallow transport errors silently so the manual-registration
instructions are the only thing the user sees when auto-registration
is unavailable (e.g. not logged in, older backend, offline).

Made-with: Cursor
@jeffdi jeffdi merged commit 77244bd into main Apr 21, 2026
12 checks passed
@jeffdi jeffdi deleted the fix/keygen-use-cli-ssh-key-endpoint branch April 21, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants