public SaslStormServerHandler(ISaslServer server) throws IOException { this.server = server; getSASLCredentials(); }
@Override protected void initChannel(Channel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("encoder", new ThriftEncoder()); pipeline.addLast("decoder", new ThriftDecoder(thriftMessageMaxSizeBytes)); if (authMethod == AuthMethod.DIGEST) { try { LOG.debug("Adding SaslStormServerHandler to pacemaker server pipeline."); pipeline.addLast(SASL_HANDLER, new SaslStormServerHandler((ISaslServer) server)); } catch (IOException e) { throw new RuntimeException(e); } } else if (authMethod == AuthMethod.KERBEROS) { try { LOG.debug("Adding KerberosSaslServerHandler to pacemaker server pipeline."); ArrayList<String> authorizedUsers = new ArrayList<>(1); authorizedUsers.add((String) topoConf.get(DaemonConfig.NIMBUS_DAEMON_USER)); pipeline.addLast(KERBEROS_HANDLER, new KerberosSaslServerHandler((ISaslServer) server, topoConf, ClientAuthUtils.LOGIN_CONTEXT_PACEMAKER_SERVER, authorizedUsers)); } catch (IOException e) { throw new RuntimeException(e); } } else if (authMethod == AuthMethod.NONE) { LOG.debug("Not authenticating any clients. AuthMethod is NONE"); } pipeline.addLast("handler", new StormServerHandler(server)); }
@Override protected void initChannel(Channel ch) throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = ch.pipeline(); // Decoder pipeline.addLast("decoder", new MessageDecoder(new KryoValuesDeserializer(topoConf))); // Encoders pipeline.addLast("netty-serializable-encoder", NettySerializableMessageEncoder.INSTANCE); pipeline.addLast("backpressure-encoder", new BackPressureStatusEncoder(new KryoValuesSerializer(topoConf))); boolean isNettyAuth = (Boolean) topoConf .get(Config.STORM_MESSAGING_NETTY_AUTHENTICATION); if (isNettyAuth) { // Authenticate: Removed after authentication completes pipeline.addLast("saslServerHandler", new SaslStormServerHandler( server)); // Authorize pipeline.addLast("authorizeServerHandler", new SaslStormServerAuthorizeHandler()); } // business logic. pipeline.addLast("handler", new StormServerHandler(server)); } }
try { LOG.debug("Adding SaslStormServerHandler to pacemaker server pipeline."); pipeline.addLast(SASL_HANDLER, new SaslStormServerHandler((ISaslServer)server));
public SaslStormServerHandler(ISaslServer server) throws IOException { this.server = server; getSASLCredentials(); }
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = Channels.pipeline(); // Decoder pipeline.addLast("decoder", new MessageDecoder()); // Encoder pipeline.addLast("encoder", new MessageEncoder()); boolean isNettyAuth = (Boolean) this.server.storm_conf .get(Config.STORM_MESSAGING_NETTY_AUTHENTICATION); if (isNettyAuth) { // Authenticate: Removed after authentication completes pipeline.addLast("saslServerHandler", new SaslStormServerHandler( server)); // Authorize pipeline.addLast("authorizeServerHandler", new SaslStormServerAuthorizeHandler()); } // business logic. pipeline.addLast("handler", new StormServerHandler(server)); return pipeline; } }