Class SamplePushAuthHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
com.netflix.zuul.netty.server.push.PushAuthHandler
com.netflix.zuul.sample.push.SamplePushAuthHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

@Sharable public class SamplePushAuthHandler extends com.netflix.zuul.netty.server.push.PushAuthHandler
Takes cookie value of the cookie "userAuthCookie" as a customerId WITHOUT ANY actual validation. For sample puprose only. In real life the cookies at minimum should be HMAC signed to prevent tampering/spoofing, probably encrypted too if it can be exchanged on plain HTTP. Author: Susheel Aroskar Date: 5/16/18
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields inherited from class com.netflix.zuul.netty.server.push.PushAuthHandler

    NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.netflix.zuul.netty.server.push.PushUserAuth
    doAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx)
     
    protected boolean
    isDelayedAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx)
    We support only cookie based auth in this sample

    Methods inherited from class com.netflix.zuul.netty.server.push.PushAuthHandler

    channelRead0, isInvalidOrigin, parseCookies, sendHttpResponse

    Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerAdded, handlerRemoved
  • Constructor Details

    • SamplePushAuthHandler

      public SamplePushAuthHandler(String path)
  • Method Details

    • isDelayedAuth

      protected boolean isDelayedAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx)
      We support only cookie based auth in this sample
      Specified by:
      isDelayedAuth in class com.netflix.zuul.netty.server.push.PushAuthHandler
    • doAuth

      protected com.netflix.zuul.netty.server.push.PushUserAuth doAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      doAuth in class com.netflix.zuul.netty.server.push.PushAuthHandler