public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { String id = cnxn.getRemoteSocketAddress().getAddress().getHostAddress(); cnxn.addAuthInfo(new Id(getScheme(), id)); return KeeperException.Code.OK; }
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.getDeclaredConstructor() .newInstance(); authenticationProviders.put(ap.getScheme(), ap); } catch (Exception e) { LOG.warn("Problems loading " + className,e); } } } initialized = true; } }
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { String id = cnxn.getRemoteSocketAddress().getAddress().getHostAddress(); cnxn.addAuthInfo(new Id(getScheme(), id)); return KeeperException.Code.OK; }
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 .getDeclaredConstructor().newInstance(); authenticationProviders.put(ap.getScheme(), ap); } catch (Exception e) { LOG.warn("Problems loading " + className,e); } } } initialized = true; } }
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { String id = cnxn.getRemoteAddress().getAddress().getHostAddress(); cnxn.getAuthInfo().add(new Id(getScheme(), id)); return KeeperException.Code.OK; }
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; } }