Package com.netflix.zuul.sample.push
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected com.netflix.zuul.netty.server.push.PushUserAuthdoAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx) protected booleanisDelayedAuth(io.netty.handler.codec.http.FullHttpRequest req, io.netty.channel.ChannelHandlerContext ctx) We support only cookie based auth in this sampleMethods inherited from class com.netflix.zuul.netty.server.push.PushAuthHandler
channelRead0, isInvalidOrigin, parseCookies, sendHttpResponseMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
SamplePushAuthHandler
-
-
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:
isDelayedAuthin classcom.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:
doAuthin classcom.netflix.zuul.netty.server.push.PushAuthHandler
-