public SampleWebSocketPushChannelInitializer(int port, ChannelConfig channelConfig, ChannelConfig channelDependencies, ChannelGroup channels) { super(port, channelConfig, channelDependencies, channels); pushConnectionRegistry = channelDependencies.get(ZuulDependencyKeys.pushConnectionRegistry); pushAuthHandler = new SamplePushAuthHandler(PushProtocol.WEBSOCKET.getPath()); }
@Override protected PushUserAuth doAuth(FullHttpRequest req) { final Cookies cookies = parseCookies(req); for (final Cookie c : cookies.getAll()) { if(c.getName().equals("userAuthCookie")) { final String customerId = c.getValue(); if (!Strings.isNullOrEmpty(customerId)) { return new SamplePushUserAuth(customerId); } } } return new SamplePushUserAuth(HttpResponseStatus.UNAUTHORIZED.code()); }
public SampleSSEPushChannelInitializer(int port, ChannelConfig channelConfig, ChannelConfig channelDependencies, ChannelGroup channels) { super(port, channelConfig, channelDependencies, channels); pushConnectionRegistry = channelDependencies.get(ZuulDependencyKeys.pushConnectionRegistry); pushAuthHandler = new SamplePushAuthHandler(PushProtocol.SSE.getPath()); }
@Override protected PushUserAuth doAuth(FullHttpRequest req) { final Cookies cookies = parseCookies(req); for (final Cookie c : cookies.getAll()) { if(c.getName().equals("userAuthCookie")) { final String customerId = c.getValue(); if (!Strings.isNullOrEmpty(customerId)) { return new SamplePushUserAuth(customerId); } } } return new SamplePushUserAuth(HttpResponseStatus.UNAUTHORIZED.code()); }
public SampleSSEPushChannelInitializer(int port, ChannelConfig channelConfig, ChannelConfig channelDependencies, ChannelGroup channels) { super(port, channelConfig, channelDependencies, channels); pushConnectionRegistry = channelDependencies.get(ZuulDependencyKeys.pushConnectionRegistry); pushAuthHandler = new SamplePushAuthHandler(PushProtocol.SSE.getPath()); }
public SampleWebSocketPushChannelInitializer(int port, ChannelConfig channelConfig, ChannelConfig channelDependencies, ChannelGroup channels) { super(port, channelConfig, channelDependencies, channels); pushConnectionRegistry = channelDependencies.get(ZuulDependencyKeys.pushConnectionRegistry); pushAuthHandler = new SamplePushAuthHandler(PushProtocol.WEBSOCKET.getPath()); }