Github user revans2 commented on a diff in the pull request:
https://github.com/apache/incubator-storm/pull/202#discussion_r15409160
--- Diff:
storm-core/src/jvm/backtype/storm/messaging/netty/StormServerPipelineFactory.java
---
@@ -33,13 +36,27 @@ 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());
- // business logic.
- pipeline.addLast("handler", new StormServerHandler(server));
-
+ boolean isNettyAuth = (Boolean)
this.server.storm_conf.get(Config.STORM_MESSAGING_NETTY_AUTHENTICATION);
+ if(isNettyAuth) {
+ // Decoder
+ pipeline.addLast("decoder", new MessageDecoder());
+ // Encoder
+ pipeline.addLast("encoder", new MessageEncoder());
+ // 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));
+ } else {
+ // Decoder
+ pipeline.addLast("decoder", new MessageDecoder());
+ // Encoder
+ pipeline.addLast("encoder", new MessageEncoder());
+ // business logic.
+ pipeline.addLast("handler", new StormServerHandler(server));
+ }
+
--- End diff --
Similar here, could we try to combine as much of the if/else blocks
together do that the sasl handling is the only thing in the if block.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---