Skip to content

feat(cli): support header and header-command in config-ssh #10413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 7, 2024
Prev Previous commit
Next Next commit
chore: more test cases
  • Loading branch information
JoshVee committed Oct 19, 2023
commit a785392ebe2cfe940a6922b45f8e0146ded8d23d
30 changes: 29 additions & 1 deletion cli/configssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,35 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
ProvisionApply: echo.ProvisionApplyWithAgent(""),
},
wantConfig: wantConfig{
regexMatch: "--header-command /foo/bar/coder ssh",
regexMatch: "--header-command \"/foo/bar/coder\" ssh",
},
},
{
name: "Header command with double quotes",
args: []string{
"--header-command", "/foo/bar/coder arg1 arg2=\"quoted value\"",
},
wantErr: false,
echoResponse: &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(""),
},
wantConfig: wantConfig{
regexMatch: "--header-command \"/foo/bar/coder arg1 arg2=\\\"quoted value\\\"\" ssh",
},
},
{
name: "Header command with single quotes",
args: []string{
"--header-command", "/foo/bar/coder arg1 arg2='quoted value'",
},
wantErr: false,
echoResponse: &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(""),
},
wantConfig: wantConfig{
regexMatch: "--header-command \"/foo/bar/coder arg1 arg2='quoted value'\" ssh",
},
},
}
Expand Down