do not log full password
This commit is contained in:
parent
a696ddfc31
commit
b353e00b6c
@ -9,6 +9,7 @@ import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import de.hsadmin.core.util.Config;
|
||||
import de.hsadmin.core.util.TextUtil;
|
||||
|
||||
public class JDBCProcessor extends AbstractProcessor {
|
||||
|
||||
@ -48,7 +49,7 @@ public class JDBCProcessor extends AbstractProcessor {
|
||||
throw new ProcessorException("database admin-user configuration failed");
|
||||
}
|
||||
}
|
||||
LOG.info("process() - DB-User: " + user + " Password: " + password);
|
||||
LOG.info("process() - DB-User: " + user + " Password: " + TextUtil.hidePassword(password));
|
||||
try {
|
||||
Class.forName(driver);
|
||||
c = DriverManager.getConnection(url, user, password);
|
||||
|
@ -76,4 +76,12 @@ public class TextUtil {
|
||||
return parsedValue;
|
||||
}
|
||||
|
||||
public static synchronized String hidePassword(String passwd) {
|
||||
StringBuffer val = new StringBuffer(passwd.substring(0, 2));
|
||||
for (int i = 2; i < passwd.length(); i++) {
|
||||
val.append('*');
|
||||
}
|
||||
return val.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user