feat(vault): add host connection test to the host editor - #2984
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7a1890d4a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| testMode: true, | ||
| reuseTransport: false, |
There was a problem hiding this comment.
Route jump-host MFA prompts outside terminal scope
When the tested host uses a jump host that requires keyboard-interactive/MFA, this test-mode launch does not set _keyboardInteractiveScope for connectThroughChain; that function defaults jump prompts to terminal scope, and the renderer rejects terminal-scoped prompts whose session id is not in the terminal session list (application/app/useAppStartupEffects.ts:34-45). The target host prompt was switched to external scope, but the jump-host prompt is still auto-cancelled before the user can answer, so the new connection test fails for MFA bastions even though a normal terminal connection can succeed.
Useful? React with 👍 / 👎.
|
目前是啥情况 |
Add a 'Test' button next to Save in the host editor that opens a dialog reusing the terminal's connection progress/auth/host-key UI, and runs a headless connection probe: - Main process: netcatty:test-connection reuses startSSHSession in a testMode that authenticates then tears down without opening a shell, reports via netcatty:test:result, and supports cancellation (netcatty:test-connection:cancel). - Renderer: useHostConnectionTest hook + HostConnectionTestDialog component; single-credential auth (no agent/default-key fallback) with short test timeouts (8s TCP / 15s auth). - Reuses terminal chain progress, host-key verification, and auth prompts; success keeps the same dialog with retry/close.
5c1d56c to
4e6498a
Compare
Register the headless test-connection transport before connectThroughChain / createProxySocket runs, and update its pendingConn / chainConnections as hops and proxy sockets are established. This lets cancelTestConnection abort a slow/unreachable bastion or proxy dial instead of leaving it running until timeout.
4e6498a to
6965e49
Compare
Summary
Adds a "Test connection" button to the host editor (save / new-host aside panel). Clicking it opens a dialog that reuses the terminal's own connection UI — progress bar, per-hop jump-host chain, host-key verification, and password/2FA prompts — and runs a headless connection probe that authenticates and disconnects without opening a shell.
Type of Change
Related Issue (optional)
N/A
Changes Made
netcatty:test-connectionIPC channel reusesstartSSHSessionin atestModethat authenticates then tears down without opening a shell. Outcome is reported via a dedicatednetcatty:test:resultevent, with cancellation vianetcatty:test-connection:cancel.useHostConnectionTesthook +HostConnectionTestDialogcomponent (portal-mounted, reusesTerminalConnectionDialogverbatim).~/.sshdefault-key fallback chain) with short test-only timeouts (8s TCP / 15s auth).en/zh-CN/zh-TW/ru.Screenshots / Demo
N/A
Testing
npm run dev)npm run lint)domain/hostConnectionTest.test.ts,electron/bridges/sshBridge/startSession.testConnection.test.cjs, plusstartSession.agentForwarding,execCommand.systemAgent,HostDetailsPanel.proxyProfile,TerminalConnectionDialogregressions (68 tests, all passing)npm run generate:capability-tools)Checklist