diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/MySQLAuthHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/MySQLAuthHandler.java index 0cdde91d..41d65110 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/MySQLAuthHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/MySQLAuthHandler.java @@ -8,6 +8,7 @@ import java.util.UUID; import ru.gravit.launchserver.auth.MySQLSourceConfig; +import ru.gravit.utils.helper.LogHelper; public final class MySQLAuthHandler extends CachedAuthHandler { private MySQLSourceConfig mySQLHolder; @@ -25,6 +26,13 @@ public final class MySQLAuthHandler extends CachedAuthHandler { @Override public void init() { + //Verify + if(mySQLHolder == null) LogHelper.error("[Verify][AuthHandler] mySQLHolder cannot be null"); + if(uuidColumn == null) LogHelper.error("[Verify][AuthHandler] uuidColumn cannot be null"); + if(usernameColumn == null) LogHelper.error("[Verify][AuthHandler] usernameColumn cannot be null"); + if(accessTokenColumn == null) LogHelper.error("[Verify][AuthHandler] accessTokenColumn cannot be null"); + if(serverIDColumn == null) LogHelper.error("[Verify][AuthHandler] serverIDColumn cannot be null"); + if(table == null) LogHelper.error("[Verify][AuthHandler] table cannot be null"); // Prepare SQL queries queryByUUIDSQL = String.format("SELECT %s, %s, %s, %s FROM %s WHERE %s=? LIMIT 1", uuidColumn, usernameColumn, accessTokenColumn, serverIDColumn, table, uuidColumn); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java index b3554bd5..9f2dcdb0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java @@ -9,6 +9,7 @@ import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launchserver.auth.MySQLSourceConfig; import ru.gravit.utils.helper.CommonHelper; +import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.SecurityHelper; public final class MySQLAuthProvider extends AuthProvider { @@ -18,6 +19,13 @@ public final class MySQLAuthProvider extends AuthProvider { private String[] queryParams; private boolean usePermission; + @Override + public void init() { + if(query == null) LogHelper.error("[Verify][AuthProvider] query cannot be null"); + if(message == null) LogHelper.error("[Verify][AuthProvider] message cannot be null"); + if(mySQLHolder == null) LogHelper.error("[Verify][AuthProvider] mySQLHolder cannot be null"); + } + @Override public AuthProviderResult auth(String login, String password, String ip) throws SQLException, AuthException { Connection c = mySQLHolder.getConnection(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RequestAuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RequestAuthProvider.java index 0d5a10c2..917ca21e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RequestAuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RequestAuthProvider.java @@ -8,6 +8,7 @@ import ru.gravit.launcher.ClientPermissions; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.IOHelper; +import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.SecurityHelper; public final class RequestAuthProvider extends AuthProvider { @@ -19,6 +20,8 @@ public final class RequestAuthProvider extends AuthProvider { @Override public void init() { + if(url == null) LogHelper.error("[Verify][AuthProvider] url cannot be null"); + if(response == null) LogHelper.error("[Verify][AuthProvider] response cannot be null"); pattern = Pattern.compile(response); }