Search in sources :

Example 1 with DigestAuthenticationProvider

use of org.apache.zookeeper_voltpatches.server.auth.DigestAuthenticationProvider in project voltdb by VoltDB.

the class ProviderRegistry method initialize.

public static void initialize() {
    synchronized (ProviderRegistry.class) {
        if (initialized)
            return;
        IPAuthenticationProvider ipp = new IPAuthenticationProvider();
        DigestAuthenticationProvider digp = new DigestAuthenticationProvider();
        authenticationProviders.put(ipp.getScheme(), ipp);
        authenticationProviders.put(digp.getScheme(), digp);
        Enumeration<Object> en = System.getProperties().keys();
        while (en.hasMoreElements()) {
            String k = (String) en.nextElement();
            if (k.startsWith("zookeeper.authProvider.")) {
                String className = System.getProperty(k);
                try {
                    Class<?> c = ZooKeeperServer.class.getClassLoader().loadClass(className);
                    AuthenticationProvider ap = (AuthenticationProvider) c.newInstance();
                    authenticationProviders.put(ap.getScheme(), ap);
                } catch (Exception e) {
                    LOG.warn("Problems loading " + className, e);
                }
            }
        }
        initialized = true;
    }
}
Also used : IPAuthenticationProvider(org.apache.zookeeper_voltpatches.server.auth.IPAuthenticationProvider) ProviderRegistry(org.apache.zookeeper_voltpatches.server.auth.ProviderRegistry) AuthenticationProvider(org.apache.zookeeper_voltpatches.server.auth.AuthenticationProvider) DigestAuthenticationProvider(org.apache.zookeeper_voltpatches.server.auth.DigestAuthenticationProvider) IPAuthenticationProvider(org.apache.zookeeper_voltpatches.server.auth.IPAuthenticationProvider) ZooKeeperServer(org.apache.zookeeper_voltpatches.server.ZooKeeperServer) DigestAuthenticationProvider(org.apache.zookeeper_voltpatches.server.auth.DigestAuthenticationProvider)

Aggregations

ZooKeeperServer (org.apache.zookeeper_voltpatches.server.ZooKeeperServer)1 AuthenticationProvider (org.apache.zookeeper_voltpatches.server.auth.AuthenticationProvider)1 DigestAuthenticationProvider (org.apache.zookeeper_voltpatches.server.auth.DigestAuthenticationProvider)1 IPAuthenticationProvider (org.apache.zookeeper_voltpatches.server.auth.IPAuthenticationProvider)1 ProviderRegistry (org.apache.zookeeper_voltpatches.server.auth.ProviderRegistry)1