Add namespace parameter to ssh helper config (#9160)

This commit is contained in:
Jim Kalafut 2020-06-08 08:16:03 -07:00 committed by GitHub
parent 49461d66a9
commit eb666e94bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,7 @@ type SSHVerifyResponse struct {
type SSHHelperConfig struct {
VaultAddr string `hcl:"vault_addr"`
SSHMountPoint string `hcl:"ssh_mount_point"`
Namespace string `hcl:"namespace"`
CACert string `hcl:"ca_cert"`
CAPath string `hcl:"ca_path"`
AllowedCidrList string `hcl:"allowed_cidr_list"`
@ -123,6 +124,11 @@ func (c *SSHHelperConfig) NewClient() (*Client, error) {
return nil, err
}
// Configure namespace
if c.Namespace != "" {
client.SetNamespace(c.Namespace)
}
return client, nil
}
@ -155,6 +161,7 @@ func ParseSSHHelperConfig(contents string) (*SSHHelperConfig, error) {
valid := []string{
"vault_addr",
"ssh_mount_point",
"namespace",
"ca_cert",
"ca_path",
"allowed_cidr_list",