Skip to content

Commit

Permalink
fix(log): replace the plaintext password with *** in log (#1197)
Browse files Browse the repository at this point in the history
Signed-off-by: Jianxiang Ran <rxan_embedded@163.com>
  • Loading branch information
superrxan authored Mar 2, 2022
1 parent cf0d7b7 commit f8362a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/topo/connection/clients/client_registy.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func GetClient(connectionType string, props map[string]interface{}) (api.Message
} else {
cliWpr, err := clientCreator(props)
if err != nil {
conf.Log.Errorf("can not create client for cfg : %v have error %s", props, err)
conf.Log.Errorf("can not create client for cfg : %v have error %s", conf.Printable(props), err)
return nil, err
}
conf.Log.Infof("Init client wrapper for client type %s", connectionType)
Expand Down
6 changes: 3 additions & 3 deletions internal/topo/connection/clients/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ func (ms *MQTTClient) CfgValidate(props map[string]interface{}) error {

err := cast.MapToStruct(props, &cfg)
if err != nil {
return fmt.Errorf("failed to get config for %v, the error is %s", cfg, err)
return fmt.Errorf("failed to get config, the error is %s", err)
}

if srv := cfg.Servers; len(srv) != 0 {
ms.srv = srv[0]
} else if cfg.Server != "" {
ms.srv = cfg.Server
} else {
return fmt.Errorf("missing server property for %v", cfg)
return fmt.Errorf("missing server property")
}

if cfg.ClientId == "" {
if newUUID, err := uuid.NewUUID(); err != nil {
return fmt.Errorf("failed to get uuid for %v, the error is %s", cfg, err)
return fmt.Errorf("failed to get uuid, the error is %s", err)
} else {
ms.clientid = newUUID.String()
}
Expand Down

0 comments on commit f8362a7

Please sign in to comment.