From 683d71b833b61108abab0ca1d249c2461ce1e94d Mon Sep 17 00:00:00 2001 From: Bence Csati <113284287+csatib02@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:34:08 +0100 Subject: [PATCH] fix: add VAULT_LOG_LEVEL env to sanitize so it can be set (#87) * fix: add VAULT_LOG_LEVEL env to sanitize so it can be set Signed-off-by: Bence Csati * chore: comment Signed-off-by: Bence Csati --------- Signed-off-by: Bence Csati --- pkg/provider/vault/config.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pkg/provider/vault/config.go b/pkg/provider/vault/config.go index 3a505d9..800db50 100644 --- a/pkg/provider/vault/config.go +++ b/pkg/provider/vault/config.go @@ -56,6 +56,7 @@ const ( TransitBatchSizeEnv = "VAULT_TRANSIT_BATCH_SIZE" IgnoreMissingSecretsEnv = "VAULT_IGNORE_MISSING_SECRETS" PassthroughEnv = "VAULT_PASSTHROUGH" + LogLevelEnv = "VAULT_LOG_LEVEL" RevokeTokenEnv = "VAULT_REVOKE_TOKEN" FromPathEnv = "VAULT_FROM_PATH" ) @@ -107,6 +108,7 @@ var sanitizeEnvmap = map[string]envType{ TransitBatchSizeEnv: {login: false}, IgnoreMissingSecretsEnv: {login: false}, PassthroughEnv: {login: false}, + LogLevelEnv: {login: false}, RevokeTokenEnv: {login: false}, FromPathEnv: {login: false}, } @@ -164,17 +166,16 @@ func LoadConfig() (*Config, error) { } return &Config{ - IsLogin: isLogin, - Token: vaultToken, - TokenFile: tokenFile, - Role: role, - AuthPath: authPath, - AuthMethod: authMethod, - TransitKeyID: os.Getenv(TransitKeyIDEnv), - TransitPath: os.Getenv(TransitPathEnv), - TransitBatchSize: cast.ToInt(os.Getenv(TransitBatchSizeEnv)), - // Used both for reading secrets and transit encryption - IgnoreMissingSecrets: cast.ToBool(os.Getenv(IgnoreMissingSecretsEnv)), + IsLogin: isLogin, + Token: vaultToken, + TokenFile: tokenFile, + Role: role, + AuthPath: authPath, + AuthMethod: authMethod, + TransitKeyID: os.Getenv(TransitKeyIDEnv), + TransitPath: os.Getenv(TransitPathEnv), + TransitBatchSize: cast.ToInt(os.Getenv(TransitBatchSizeEnv)), + IgnoreMissingSecrets: cast.ToBool(os.Getenv(IgnoreMissingSecretsEnv)), // Used both for reading secrets and transit encryption FromPath: os.Getenv(FromPathEnv), RevokeToken: cast.ToBool(os.Getenv(RevokeTokenEnv)), }, nil