/** * Wrap the given application handler in a SaslRpcHandler that will handle the initial SASL * negotiation. */ public RpcHandler doBootstrap(Channel channel, RpcHandler rpcHandler) { return new SaslRpcHandler(conf, channel, rpcHandler, secretKeyHolder); }
private void doSaslAuth(TransportClient client, Channel channel) { SaslClientBootstrap sasl = new SaslClientBootstrap(conf, appId, secretKeyHolder); sasl.doBootstrap(client, channel); }
/** * Wrap the incoming message in an implementation that will perform encryption lazily. This is * needed to guarantee ordering of the outgoing encrypted packets - they need to be decrypted in * the same order, and netty doesn't have an atomic ChannelHandlerContext.write() API, so it * does not guarantee any ordering. */ @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { ctx.write(new EncryptedMessage(backend, msg, maxOutboundBlockSize), promise); }
private void complete(boolean dispose) { if (dispose) { try { saslServer.dispose(); } catch (RuntimeException e) { logger.error("Error while disposing SASL server", e); } } saslServer = null; isComplete = true; }
/** * Register an application with its secret specified as a byte buffer. */ public void registerApp(String appId, ByteBuffer shuffleSecret) { registerApp(appId, JavaUtils.bytesToString(shuffleSecret)); }
@Override public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { try { backend.dispose(); } finally { super.handlerRemoved(ctx); } }
private void doSaslAuth(TransportClient client, Channel channel) { SaslClientBootstrap sasl = new SaslClientBootstrap(conf, appId, secretKeyHolder); sasl.doBootstrap(client, channel); }
private void complete(boolean dispose) { if (dispose) { try { saslServer.dispose(); } catch (RuntimeException e) { logger.error("Error while disposing SASL server", e); } } saslServer = null; isComplete = true; }
/** * Wrap the given application handler in a SaslRpcHandler that will handle the initial SASL * negotiation. */ public RpcHandler doBootstrap(Channel channel, RpcHandler rpcHandler) { return new SaslRpcHandler(conf, channel, rpcHandler, secretKeyHolder); }
/** * Wrap the incoming message in an implementation that will perform encryption lazily. This is * needed to guarantee ordering of the outgoing encrypted packets - they need to be decrypted in * the same order, and netty doesn't have an atomic ChannelHandlerContext.write() API, so it * does not guarantee any ordering. */ @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { ctx.write(new EncryptedMessage(backend, msg, maxOutboundBlockSize), promise); }
@Override public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { try { backend.dispose(); } finally { super.handlerRemoved(ctx); } }
private void doSaslAuth(TransportClient client, Channel channel) { SaslClientBootstrap sasl = new SaslClientBootstrap(conf, appId, secretKeyHolder); sasl.doBootstrap(client, channel); }
@Override public void channelInactive(TransportClient client) { try { delegate.channelInactive(client); } finally { if (saslServer != null) { saslServer.dispose(); } } }
/** * Wrap the given application handler in a SaslRpcHandler that will handle the initial SASL * negotiation. */ public RpcHandler doBootstrap(Channel channel, RpcHandler rpcHandler) { return new SaslRpcHandler(conf, channel, rpcHandler, secretKeyHolder); }
/** * Wrap the incoming message in an implementation that will perform encryption lazily. This is * needed to guarantee ordering of the outgoing encrypted packets - they need to be decrypted in * the same order, and netty doesn't have an atomic ChannelHandlerContext.write() API, so it * does not guarantee any ordering. */ @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { ctx.write(new EncryptedMessage(backend, msg, maxOutboundBlockSize), promise); }
@Override public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { try { backend.dispose(); } finally { super.handlerRemoved(ctx); } }
@Override public void channelInactive(TransportClient client) { try { delegate.channelInactive(client); } finally { if (saslServer != null) { saslServer.dispose(); } } }
/** * Wrap the given application handler in a SaslRpcHandler that will handle the initial SASL * negotiation. */ public RpcHandler doBootstrap(Channel channel, RpcHandler rpcHandler) { return new SaslRpcHandler(conf, channel, rpcHandler, secretKeyHolder); }
@Override public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { try { backend.dispose(); } finally { super.handlerRemoved(ctx); } }
@Override public void channelInactive(TransportClient client) { try { delegate.channelInactive(client); } finally { if (saslServer != null) { saslServer.dispose(); } } }