2
0

redact passwords in parse config errors

Redact passwords when printing the parseConfigError in a best effort manner.
This prevents people from leaking the password into logs, if they just print the error in logs.
This commit is contained in:
Lukas Vogel
2020-06-12 13:01:57 +02:00
parent a1b9eb4d4e
commit f27e874d55
3 changed files with 83 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
// File export_test exports some methods for better testing.
package pgconn
func NewParseConfigError(conn, msg string, err error) error {
return &parseConfigError{
connString: conn,
msg: msg,
err: err,
}
}