Skip to content

Commit

Permalink
fix: add VAULT_LOG_LEVEL env to sanitize so it can be set (#87)
Browse files Browse the repository at this point in the history
* fix: add VAULT_LOG_LEVEL env to sanitize so it can be set

Signed-off-by: Bence Csati <bcsati@cisco.com>

* chore: comment

Signed-off-by: Bence Csati <bcsati@cisco.com>

---------

Signed-off-by: Bence Csati <bcsati@cisco.com>
  • Loading branch information
csatib02 authored Feb 28, 2024
1 parent 411c8d3 commit 683d71b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pkg/provider/vault/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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},
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 683d71b

Please # to comment.