Add clientID parameter to the IAuthenticator interface (breaks compatibility).

This commit is contained in:
Martin Crawford
2016-06-26 10:01:15 -04:00
parent 693a9a454f
commit d622adb4ef
11 changed files with 51 additions and 37 deletions
@@ -6,7 +6,7 @@ import io.moquette.spi.security.IAuthenticator;
* Created by andrea on 8/23/14.
*/
public class AcceptAllAuthenticator implements IAuthenticator {
public boolean checkValid(String username, byte[] password) {
public boolean checkValid(String clientId, String username, byte[] password) {
return true;
}
}
@@ -63,7 +63,7 @@ public class DBAuthenticator implements IAuthenticator {
}
@Override
public synchronized boolean checkValid(String username, byte[] password) {
public synchronized boolean checkValid(String clientId, String username, byte[] password) {
// Check Username / Password in DB using sqlQuery
if (username == null || password == null) {
LOG.info("username or password was null");
@@ -106,8 +106,9 @@ public class FileAuthenticator implements IAuthenticator {
throw new ParseException("Failed to read", 1);
}
}
public boolean checkValid(String username, byte[] password) {
@Override
public boolean checkValid(String clientId, String username, byte[] password) {
if (username == null || password == null) {
LOG.info("username or password was null");
return false;