#1104 Filter all sensitive command aliases in console filters

This commit is contained in:
ljacqu
2017-02-20 22:09:36 +01:00
parent 18d8186804
commit 922101d755
2 changed files with 89 additions and 5 deletions
@@ -1,17 +1,21 @@
package fr.xephi.authme.output;
import com.google.common.annotations.VisibleForTesting;
import fr.xephi.authme.util.StringUtils;
/**
* Service class for the log filters.
*/
public final class LogFilterHelper {
final class LogFilterHelper {
private static final String ISSUED_COMMAND_TEXT = "issued server command:";
private static final String[] COMMANDS_TO_SKIP = {"/login ", "/l ", "/reg ", "/changepassword ",
"/unregister ", "/authme register ", "/authme changepassword ", "/authme reg ", "/authme cp ",
"/register "};
@VisibleForTesting
static final String[] COMMANDS_TO_SKIP = {
"/login ", "/l ", "/log ", "/register ", "/reg ", "/unregister ", "/unreg ",
"/changepassword ", "/cp ", "/changepass ", "/authme register ", "/authme reg ", "/authme r ",
"/authme changepassword ", "/authme password ", "/authme changepass ", "/authme cp "
};
private LogFilterHelper() {
// Util class
@@ -24,7 +28,7 @@ public final class LogFilterHelper {
*
* @return True if it is a sensitive AuthMe command, false otherwise
*/
public static boolean isSensitiveAuthMeCommand(String message) {
static boolean isSensitiveAuthMeCommand(String message) {
if (message == null) {
return false;
}