Repository navigation
feat: Windows host access (1.4.0 batch) - #57
Conversation
…config import Add keyboard-interactive auth, optional OpenCode SSH local forward, and OpenSSH config import with profile search/favorites/duplicate for the 1.4.0 host-access batch. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reviewer's GuideData structuresAdd persisted profile options for agent tunneling and favorites, including backward-compatible defaults and serialization.
Attach the active SSH forward to agent connections so its lifecycle can be cleaned up with the connection.
APIExpose SSH keyboard-interactive prompt handling and connected-session lookup, and wire keyboard-interactive authentication into SSH connection setup.
Add the local-forward service interface for binding loopback and forwarding accepted sockets through SSH.
Add parsing and import interfaces for reading remote OpenSSH config and merging entries into profiles.
Uses of the APIPass the shared SSH provider to the agent provider so tunnel-enabled profiles can reuse SSH sessions.
Prepare an SSH local forward for tunnel-enabled profiles and retain or close it as agent connections succeed or fail.
Connect keyboard-interactive SSH prompts to the secure dialog from the home screen.
UIAdd the keyboard-interactive prompt dialog, masking non-echo responses and returning answers or cancellation.
Add profile search, favorite sorting and pinning, config import, duplication, and controls for the new profile options.
DocumentationDocument keyboard-interactive authentication, profile management, SSH config import, and the optional agent tunnel.
TestsTest profile option persistence, SSH config parsing and merging, local-forward lifecycle, and keyboard-interactive dialog behavior.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| autofocus: i == 0, | ||
| obscureText: !request.prompts[i].echo, | ||
| decoration: InputDecoration( | ||
| labelText: request.prompts[i].promptText.trim().isEmpty |
There was a problem hiding this comment.
CRITICAL: SSHUserInfoPrompt has no promptText field — this will not compile
In dartssh2, SSHUserInfoPrompt exposes the prompt string as prompt (constructor is SSHUserInfoPrompt(prompt, echo)). request.prompts[i].promptText is an undefined getter, so this file fails to compile and the widget test that imports it cannot run. Use request.prompts[i].prompt.
| } | ||
|
|
||
| void _duplicateProfile(BuildContext context, SSHProfile profile) { | ||
| final copy = SSHProfile( |
There was a problem hiding this comment.
WARNING: Duplicating a profile silently drops isServer
_duplicateProfile rebuilds SSHProfile field-by-field but never passes isServer, so it defaults to false. Duplicating a server profile silently turns the copy into a client profile, which changes behavior in share/widget flows that filter on !p.isServer. Also pass isServer: profile.isServer.
| socket.destroy(); | ||
| return; | ||
| } | ||
| _localSockets.add(socket); |
There was a problem hiding this comment.
WARNING: Per-connection sockets/channels are never removed from the tracking lists
_localSockets (line 90) and _channels (line 94) only ever grow: entries are added here but the onDone/onError handlers destroy the socket/channel without pruning them from these lists. For a long-lived agent tunnel serving many HTTP connections, both lists grow without bound until close(). Remove each socket/channel when its stream completes, or prune closed entries.
| fallbackUsername: session.profile.username, | ||
| ); | ||
|
|
||
| for (final profile in merged.profiles) { |
There was a problem hiding this comment.
SUGGESTION: Re-saving every merged profile is O(n²) I/O
merged.profiles contains the existing profiles plus the new ones, and this loop calls saveProfile (which writes secure storage, rewrites the full profile list, and notifies listeners) once per profile. For a large ~/.ssh/config that is many redundant disk writes and UI rebuilds. Save only the created/updated profiles, or add a batch-save path.
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (19 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 142.4K · Output: 63.4K · Cached: 2.4M |
Summary
127.0.0.1:agentPort.~/.ssh/configfrom the connected host; profile search, favorites, and duplicate.Related issues
N/A — 1.4.0 host-access feature batch.
Type of change
Platform tested
Test plan
flutter pub getflutter analyze(no errors)flutter testSteps:
flutter test test/utils/ssh_config_parser_test.dart test/services/ssh_config_import_service_test.dart test/services/ssh_local_forward_test.dart test/widgets/keyboard_interactive_dialog_test.dart test/models/ssh_profile_agent_auth_test.dart~/.ssh/configin Profile Manager; search, pin, and duplicate a profile.Screenshots / recordings
N/A — auth dialog and profile manager polish; manual screenshots optional after device test.
Checklist
analysis_options.yamlSummary by Sourcery
Expand Windows and OpenSSH host access with interactive authentication, agent tunneling, configuration import, and improved profile management.
New Features:
Enhancements:
Documentation:
Tests:
Chores: