Skip to content

Commit

Permalink
fix: drop logging sensitive information
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdand-weka committed Feb 8, 2024
1 parent 7e235d9 commit 16bac64
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions internal/local/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func chartSpec(client helmclient.Client, opts *HelmOptions) (*helmclient.ChartSp
}

logger.Debug().
Interface("configuration", opts.Config).
Interface("configuration", opts.Config.LoggingSafe()).
Msg("Generating chart values")

values, err := generateValuesV3(opts.Config)
Expand All @@ -67,12 +67,11 @@ func chartSpec(client helmclient.Client, opts *HelmOptions) (*helmclient.ChartSp
return nil, fmt.Errorf("failed serializing values yaml: %w", err)
}

logger.Debug().Msgf("Helm values.yaml:\n%s", string(opts.Values))

chartVersion := "" // any available
if opts.Override != nil {
chartVersion = opts.Override.Version
}

return &helmclient.ChartSpec{
ReleaseName: ReleaseName,
ChartName: chartLocation,
Expand Down
3 changes: 0 additions & 3 deletions internal/local/chart/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ func (g *yamlGenerator) Generate(configuration *config_v1.Configuration) (yamlMa

return nil, err
}

logger.Debug().Interface("result", result).Interface("visitorResult", visitorResult).Msg("Generated yaml")

}

return result, nil
Expand Down
2 changes: 0 additions & 2 deletions internal/local/chart/v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ func configureOverrides(configuration *config_v1.Configuration) (yamlMap, error)
err = errors.Join(err, writeMapEntry(cfg, key, v))
}

logger.Debug().Interface("overrides", cfg).Msg("Overrides")

return cfg, err
}

Expand Down
7 changes: 7 additions & 0 deletions internal/local/config/v1/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ type Configuration struct {
func (c Configuration) Validate() error {
return nil
}

func (c Configuration) LoggingSafe() Configuration {
c.TLS.Cert = "HIDDEN"
c.TLS.Key = "HIDDEN"
c.SMTP.Password = "HIDDEN"
return c
}

0 comments on commit 16bac64

Please sign in to comment.