DATAMONGO-601 - Fixed exposing password by MongoDbUtils.

MongoDbUtils is now not exposing the plain password in the exception message piped into CannotGetMongoDbConnectionException but uses the newly introduced toString() method of UserCredentials (see DATACMNS-275).
This commit is contained in:
Oliver Gierke
2013-01-29 13:16:06 +01:00
parent 19ad2d3aac
commit c807b2abcf

View File

@@ -112,8 +112,8 @@ public abstract class MongoDbUtils {
String password = credentials.hasPassword() ? credentials.getPassword() : null;
if (!db.authenticate(username, password == null ? null : password.toCharArray())) {
throw new CannotGetMongoDbConnectionException("Failed to authenticate to database [" + databaseName
+ "], username = [" + username + "], password = [" + password + "]", databaseName, credentials);
throw new CannotGetMongoDbConnectionException("Failed to authenticate to database [" + databaseName + "], "
+ credentials.toString(), databaseName, credentials);
}
}
}