feat: support nested structs, structured arrays, and better secret value handling in config (#4727)

This commit is contained in:
Garrett Delfosse
2022-10-25 00:11:00 +00:00
committed by GitHub
parent f9c6220263
commit 585045b359
11 changed files with 728 additions and 548 deletions
+5 -5
View File
@@ -26,13 +26,13 @@ func TestDeploymentConfig(t *testing.T) {
// values should be returned
cfg.AccessURL.Value = hi
// values should not be returned
cfg.OAuth2GithubClientSecret.Value = hi
cfg.OIDCClientSecret.Value = hi
cfg.OAuth2.Github.ClientSecret.Value = hi
cfg.OIDC.ClientSecret.Value = hi
cfg.PostgresURL.Value = hi
cfg.SCIMAPIKey.Value = hi
client := coderdtest.New(t, &coderdtest.Options{
DeploymentConfig: &cfg,
DeploymentConfig: cfg,
})
_ = coderdtest.CreateFirstUser(t, client)
scrubbed, err := client.DeploymentConfig(ctx)
@@ -40,8 +40,8 @@ func TestDeploymentConfig(t *testing.T) {
// ensure normal values pass through
require.EqualValues(t, hi, scrubbed.AccessURL.Value)
// ensure secrets are removed
require.Empty(t, scrubbed.OAuth2GithubClientSecret.Value)
require.Empty(t, scrubbed.OIDCClientSecret.Value)
require.Empty(t, scrubbed.OAuth2.Github.ClientSecret.Value)
require.Empty(t, scrubbed.OIDC.ClientSecret.Value)
require.Empty(t, scrubbed.PostgresURL.Value)
require.Empty(t, scrubbed.SCIMAPIKey.Value)
}