diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2020-07-01 19:55:22 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2020-07-01 20:00:36 +1000 |
commit | 5d8d00fb7139612cbab9a3c1b0187816302d7d4a (patch) | |
tree | 20af3df0b4ae75d90c5498acf88de9f79d99aeb7 /internal | |
parent | 86e99068e0679755f5ecfa26d463addc2b4c1648 (diff) | |
download | gitlab-shell-5d8d00fb7139612cbab9a3c1b0187816302d7d4a.tar.gz |
Support new ssl_cert_dir config setting
Diffstat (limited to 'internal')
-rw-r--r-- | internal/config/config.go | 1 | ||||
-rw-r--r-- | internal/config/config_test.go | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index deed74d..be9efa3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -34,6 +34,7 @@ type Config struct { GitlabTracing string `yaml:"gitlab_tracing"` SecretFilePath string `yaml:"secret_file"` Secret string `yaml:"secret"` + SslCertDir string `yaml:"ssl_cert_dir"` HttpSettings HttpSettingsConfig `yaml:"http_settings"` HttpClient *client.HttpClient } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 202db6d..77351f2 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -29,6 +29,7 @@ func TestParseConfig(t *testing.T) { format string gitlabUrl string secret string + sslCertDir string httpSettings HttpSettingsConfig }{ { @@ -80,6 +81,13 @@ func TestParseConfig(t *testing.T) { secret: "an inline secret", }, { + yaml: "ssl_cert_dir: /tmp/certs", + path: path.Join(testRoot, "gitlab-shell.log"), + format: "text", + secret: "default-secret-content", + sslCertDir: "/tmp/certs", + }, + { yaml: "http_settings:\n user: user_basic_auth\n password: password_basic_auth\n read_timeout: 500", path: path.Join(testRoot, "gitlab-shell.log"), format: "text", @@ -106,6 +114,7 @@ func TestParseConfig(t *testing.T) { assert.Equal(t, tc.format, cfg.LogFormat) assert.Equal(t, tc.gitlabUrl, cfg.GitlabUrl) assert.Equal(t, tc.secret, cfg.Secret) + assert.Equal(t, tc.sslCertDir, cfg.SslCertDir) assert.Equal(t, tc.httpSettings, cfg.HttpSettings) }) } |