You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coder SSH host names follow the format
`coder-vscode.<safeHostname>--<username>--<workspace>(.<agent?>)`,
but the previous left-to-right `--` split rejected or misparsed safe
hostnames that contain `--` (Punycode, multi-dash domains).
* Parse from the right: last two segments are username and
workspace/agent; the rest is rejoined as the safe hostname.
* Require the safe hostname, username, and workspace/agent to be
non-empty; intermediate empty segments are allowed.
* Remove empty-hostname fallbacks in `pathResolver`, `secretsManager`,
and `sshConfig`; skip session lookup when no deployment is selected.
* Add regression tests for double-dash, Punycode, and consecutive-dash
safe hostnames.
Closes#937
return`# --- END CODER VSCODE ${safeHostname} ---`;
194
190
}
195
191
196
192
constructor(
@@ -248,13 +244,13 @@ export class SshConfig {
248
244
constendBlockCount=countSubstring(endBlock,raw);
249
245
if(startBlockCount!==endBlockCount){
250
246
thrownewSshConfigBadFormat(
251
-
`Malformed config: ${this.filePath} has an unterminated START CODER VSCODE ${safeHostname ? safeHostname+" " : ""}block. Each START block must have an END block.`,
247
+
`Malformed config: ${this.filePath} has an unterminated START CODER VSCODE ${safeHostname}block. Each START block must have an END block.`,
252
248
);
253
249
}
254
250
255
251
if(startBlockCount>1||endBlockCount>1){
256
252
thrownewSshConfigBadFormat(
257
-
`Malformed config: ${this.filePath} has ${startBlockCount} START CODER VSCODE ${safeHostname ? safeHostname+" " : ""}sections. Please remove all but one.`,
253
+
`Malformed config: ${this.filePath} has ${startBlockCount} START CODER VSCODE ${safeHostname}sections. Please remove all but one.`,
0 commit comments