mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: support nested structs, structured arrays, and better secret value handling in config (#4727)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user