diff --git a/pkg/providers/bitwardensecrets/bitwardensecrets.go b/pkg/providers/bitwardensecrets/bitwardensecrets.go index f991ec4..f4688ff 100644 --- a/pkg/providers/bitwardensecrets/bitwardensecrets.go +++ b/pkg/providers/bitwardensecrets/bitwardensecrets.go @@ -25,6 +25,17 @@ type provider struct { ProjectID string } +func getConfigOrEnv(cfg api.StaticConfig, key string, envVar string, defaultValue string) string { + value := cfg.String(key) + if value == "" { + value = os.Getenv(envVar) + } + if value == "" { + value = defaultValue + } + return value +} + func New(l *log.Logger, cfg api.StaticConfig) *provider { p := &provider{ log: l,