Bug 12639: while logging events, hide value for configs containing password string in config name

Status 12639: resolved fixed
Reviewed-By: Nitin
This commit is contained in:
kishan 2012-01-17 15:08:34 +05:30
parent 68ace71ca8
commit 6aaac81ca2
1 changed files with 2 additions and 1 deletions

View File

@ -397,7 +397,8 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
Long userId = UserContext.current().getCallerUserId();
String name = cmd.getCfgName();
String value = cmd.getValue();
UserContext.current().setEventDetails(" Name: "+name +" New Value: "+((value == null) ? "" : value));
UserContext.current().setEventDetails(" Name: "+name +" New Value: "+ (((name.toLowerCase()).contains("password")) ? "*****" :
(((value == null) ? "" : value))));
// check if config value exists
if (_configDao.findByName(name) == null) {
throw new InvalidParameterValueException("Config parameter with name " + name + " doesn't exist");