fix: mask redis credentials when logging (#2264)

This commit is contained in:
mycodeself
2022-06-06 10:07:08 +02:00
committed by GitHub
parent d8b59efea9
commit a17c3eec2a
3 changed files with 49 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ type Cache struct {
// NewCache is the factory method for Cache
func NewCache(c option.CacheOption) (Cache, error) {
if strings.HasPrefix(c.CacheBackend, "redis://") {
log.Logger.Infof("Redis cache: %s", c.CacheBackend)
log.Logger.Infof("Redis cache: %s", c.CacheBackendMasked())
options, err := redis.ParseURL(c.CacheBackend)
if err != nil {
return Cache{}, err