Added integration of DBAuthenticator & integration test with H2 DB
This commit is contained in:
committed by
Christophe Mourette
parent
cad1165071
commit
4bcecd5aa3
@@ -1,5 +1,7 @@
|
||||
package io.moquette.spi.impl.security;
|
||||
|
||||
import io.moquette.BrokerConstants;
|
||||
import io.moquette.server.config.IConfig;
|
||||
import io.moquette.spi.security.IAuthenticator;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.slf4j.Logger;
|
||||
@@ -25,6 +27,15 @@ public class DBAuthenticator implements IAuthenticator {
|
||||
private final PreparedStatement preparedStatement;
|
||||
|
||||
|
||||
|
||||
|
||||
public DBAuthenticator(IConfig conf){
|
||||
this(conf.getProperty(BrokerConstants.DB_AUTHENTICATOR_DRIVER, ""),
|
||||
conf.getProperty(BrokerConstants.DB_AUTHENTICATOR_URL,""),
|
||||
conf.getProperty(BrokerConstants.DB_AUTHENTICATOR_QUERY, ""),
|
||||
conf.getProperty(BrokerConstants.DB_AUTHENTICATOR_DIGEST,""));
|
||||
}
|
||||
|
||||
/** provide authenticator from SQL database
|
||||
* @param driver : jdbc driver class like : "org.postgresql.Driver"
|
||||
* @param jdbcUrl : jdbc url like : "jdbc:postgresql://host:port/dbname"
|
||||
|
||||
Reference in New Issue
Block a user