Repository navigation
refactor(ssh): replace the SshConfig class with module functions - #1227
Merged
Merged
Conversation
This was referenced Nov 30, 2026
EhabY
force-pushed
the
refactor/ssh-config-module
branch
from
December 1, 2026 22:07
99f117b to
6050602
Compare
jeremyruppel
reviewed
Dec 1, 2026
jeremyruppel
reviewed
Dec 1, 2026
jeremyruppel
approved these changes
Dec 1, 2026
EhabY
force-pushed
the
refactor/ssh-config-module
branch
from
December 2, 2026 10:24
6050602 to
d4c4349
Compare
EhabY
force-pushed
the
refactor/ssh-config-module
branch
from
December 2, 2026 10:37
d4c4349 to
2636242
Compare
SshConfig was only ever constructed for a single operation, and its cached raw text duplicated what the operations could return. Replace it with readSshConfig, writeCoderSshConfig and includeCoderSshConfig, which take grouped options and return the resulting text. Permissions are only accepted for the Coder file, so the user's config can never be secured. Drop the injectable FileSystem: the tests already mock node:fs/promises. Tighten the JSDoc, and remove tests made redundant by the stateless API.
EhabY
force-pushed
the
refactor/ssh-config-module
branch
from
December 2, 2026 10:41
2636242 to
1d2b4aa
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.
Closes VSC-58
Stack: #1221 (Git for Windows) → #1226 (Linux/macOS ssh home) → this PR.
No behavior change.
SshConfigwas only ever constructed for a single operation, and its cached raw text duplicated what the operations could return. It becomes three module functions that take grouped options and return the resulting text:readSshConfig(path)writeCoderSshConfig(file, host, logger): only the Coder file acceptspermissions, so the user's config can never be secured by mistake.includeCoderSshConfig(path, include, logger)Also:
FileSystemis gone, since the tests already mocknode:fs/promises.ManagedPermissionsdoc no longer calls a config without permissions unmanaged (off Windows, Coder's own file has none).prod +310/−327, tests +114/−135. The Windows test matrix from #1221 gave identical results before and after this refactor.
🤖 Generated with Claude Code