feat(security): add_ssh_key generate=true — server-side ed25519 keygen#594
Draft
dawsontoth wants to merge 1 commit into
Draft
feat(security): add_ssh_key generate=true — server-side ed25519 keygen#594dawsontoth wants to merge 1 commit into
add_ssh_key generate=true — server-side ed25519 keygen#594dawsontoth wants to merge 1 commit into
Conversation
This was referenced Jul 17, 2026
Draft
There was a problem hiding this comment.
Code Review
This pull request adds support for generating an ed25519 SSH keypair on the server side when generate: true is specified, keeping the private key secure within the cluster. Feedback on these changes focuses on performance, reliability, and type safety: using asynchronous execFile instead of blocking execFileSync to keep the event loop responsive, explicitly disallowing conflicting request parameters while wrapping key generation in a try-catch block to handle errors securely, and using Object.assign to prevent a TypeScript compilation error on the replication response.
Contributor
|
Reviewed; no blockers found. All prior findings addressed in d30fb7f. |
`add_ssh_key generate=true` (with key omitted) mints an ed25519 keypair on the node (async ssh-keygen); the minted private key flows through the same seal-at-rest + replicate path (sealSSHKey) as a client-supplied key, returning public_key for the caller to register (e.g. a GitHub deploy key). The private key never travels from the client. generate and key are mutually exclusive; the origin strips generate before replicating so peers receive a plain (sealed) key add. ssh-keygen failure (incl. not on PATH) is wrapped in a ClientError (no key material). integrationTests cover generate=true (mints, returns public_key, sealed on disk), generate+key (rejected), and neither (client error). Rebased onto main to integrate with encrypt-at-rest (#582). Relates to HarperFast/harper#1778. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dawsontoth
force-pushed
the
claude/add-ssh-key-generate
branch
from
July 20, 2026 17:46
d30fb7f to
0067f29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_ssh_key generate=true(withkeyomitted): the node mints an ed25519 keypair, stores/replicates the private half through the existing write path, and returns thepublic_keyfor the caller to register (e.g. as a GitHub deploy key). The private key never has to travel from the client.keybehaves exactly as before.key, so they never re-generate.Where:
security/sshKeyOperations.ts. Usesssh-keygenon the node. Parse + oxlint + prettier clean.Refs #570.
Related — deploy-by-reference effort
Prototype PRs: HarperFast/harper#1850 (deploy by_ref) · HarperFast/harper#1851 (deploy setup) · #594 (add_ssh_key generate) · HarperFast/create-harper#118 (create-harper scaffold)
Tracking issues: HarperFast/harper#1777 · HarperFast/harper#1778 · #570 · HarperFast/create-harper#117 · HarperFast/harper#641 (rollback)