Search in sources :

Example 1 with SimpleLdapDirectoryServer

use of org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer in project knox by apache.

the class GatewayHealthFuncTest method setupLdap.

public static void setupLdap() throws Exception {
    String basedir = System.getProperty("basedir");
    if (basedir == null) {
        basedir = new File(".").getCanonicalPath();
    }
    final Path path = FileSystems.getDefault().getPath(basedir, "/src/test/resources/users.ldif");
    ldapTransport = new TcpTransport(0);
    ldap = new SimpleLdapDirectoryServer("dc=hadoop,dc=apache,dc=org", path.toFile(), ldapTransport);
    ldap.start();
    LOG.info("LDAP port = " + ldapTransport.getPort());
}
Also used : JsonPath(io.restassured.path.json.JsonPath) Path(java.nio.file.Path) SimpleLdapDirectoryServer(org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer) TcpTransport(org.apache.directory.server.protocol.shared.transport.TcpTransport) File(java.io.File)

Example 2 with SimpleLdapDirectoryServer

use of org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer in project knox by apache.

the class GatewayTestDriver method setupLdap.

public int setupLdap(int port, File ldifConfig) throws Exception {
    ldapTransport = new TcpTransport(port);
    ldap = new SimpleLdapDirectoryServer("dc=hadoop,dc=apache,dc=org", ldifConfig, ldapTransport);
    ldap.start();
    log.info("LDAP port = " + ldapTransport.getAcceptor().getLocalAddress().getPort());
    return port;
}
Also used : SimpleLdapDirectoryServer(org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer) TcpTransport(org.apache.directory.server.protocol.shared.transport.TcpTransport)

Aggregations

TcpTransport (org.apache.directory.server.protocol.shared.transport.TcpTransport)2 SimpleLdapDirectoryServer (org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer)2 JsonPath (io.restassured.path.json.JsonPath)1 File (java.io.File)1 Path (java.nio.file.Path)1