private SaslServer createSaslServer(AuthMethod authMethod) throws IOException, InterruptedException { final Map<String,?> saslProps = saslPropsResolver.getServerProperties(addr); return new SaslRpcServer(authMethod).create(this, saslProps, secretManager); }
/** * Receives SASL negotiation for general-purpose handshake. * * @param peer connection peer * @param underlyingOut connection output stream * @param underlyingIn connection input stream * @return new pair of streams, wrapped after SASL negotiation * @throws IOException for any error */ private IOStreamPair getSaslStreams(Peer peer, OutputStream underlyingOut, InputStream underlyingIn) throws IOException { if (peer.hasSecureChannel() || dnConf.getTrustedChannelResolver().isTrusted(getPeerAddress(peer))) { return new IOStreamPair(underlyingIn, underlyingOut); } SaslPropertiesResolver saslPropsResolver = dnConf.getSaslPropsResolver(); Map<String, String> saslProps = saslPropsResolver.getServerProperties( getPeerAddress(peer)); CallbackHandler callbackHandler = new SaslServerCallbackHandler( new PasswordFunction() { @Override public char[] apply(String userName) throws IOException { return buildServerPassword(userName); } }); return doSaslHandshake(peer, underlyingOut, underlyingIn, saslProps, callbackHandler); }
private SaslServer createSaslServer(AuthMethod authMethod) throws IOException, InterruptedException { final Map<String,?> saslProps = saslPropsResolver.getServerProperties(addr); return new SaslRpcServer(authMethod).create(this, saslProps, secretManager); }
private SaslServer createSaslServer(AuthMethod authMethod) throws IOException, InterruptedException { final Map<String,?> saslProps = saslPropsResolver.getServerProperties(addr); return new SaslRpcServer(authMethod).create(this, saslProps, secretManager); }
private SaslServer createSaslServer(AuthMethod authMethod) throws IOException, InterruptedException { final Map<String,?> saslProps = saslPropsResolver.getServerProperties(addr); return new SaslRpcServer(authMethod).create(this, saslProps, secretManager); }
private SaslServer createSaslServer(AuthMethod authMethod) throws IOException, InterruptedException { final Map<String,?> saslProps = saslPropsResolver.getServerProperties(addr); return new SaslRpcServer(authMethod).create(this, saslProps, secretManager); }
/** * Receives SASL negotiation for general-purpose handshake. * * @param peer connection peer * @param underlyingOut connection output stream * @param underlyingIn connection input stream * @return new pair of streams, wrapped after SASL negotiation * @throws IOException for any error */ private IOStreamPair getSaslStreams(Peer peer, OutputStream underlyingOut, InputStream underlyingIn) throws IOException { if (peer.hasSecureChannel() || dnConf.getTrustedChannelResolver().isTrusted(getPeerAddress(peer))) { return new IOStreamPair(underlyingIn, underlyingOut); } SaslPropertiesResolver saslPropsResolver = dnConf.getSaslPropsResolver(); Map<String, String> saslProps = saslPropsResolver.getServerProperties( getPeerAddress(peer)); CallbackHandler callbackHandler = new SaslServerCallbackHandler( new PasswordFunction() { @Override public char[] apply(String userName) throws IOException { return buildServerPassword(userName); } }); return doSaslHandshake(underlyingOut, underlyingIn, saslProps, callbackHandler); }
/** * Receives SASL negotiation for general-purpose handshake. * * @param peer connection peer * @param underlyingOut connection output stream * @param underlyingIn connection input stream * @return new pair of streams, wrapped after SASL negotiation * @throws IOException for any error */ private IOStreamPair getSaslStreams(Peer peer, OutputStream underlyingOut, InputStream underlyingIn) throws IOException { if (peer.hasSecureChannel() || dnConf.getTrustedChannelResolver().isTrusted(getPeerAddress(peer))) { return new IOStreamPair(underlyingIn, underlyingOut); } SaslPropertiesResolver saslPropsResolver = dnConf.getSaslPropsResolver(); Map<String, String> saslProps = saslPropsResolver.getServerProperties( getPeerAddress(peer)); CallbackHandler callbackHandler = new SaslServerCallbackHandler( new PasswordFunction() { @Override public char[] apply(String userName) throws IOException { return buildServerPassword(userName); } }); return doSaslHandshake(underlyingOut, underlyingIn, saslProps, callbackHandler); }