Class AuthenticationHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
net.minecraft.server.jsonrpc.security.AuthenticationHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler
@Sharable
public class AuthenticationHandler
extends io.netty.channel.ChannelDuplexHandler
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext context, Object msg) private StringgetClientIp(io.netty.channel.ChannelHandlerContext context) private booleanisAllowedOriginHeader(io.netty.handler.codec.http.HttpRequest request) booleanisValidApiKey(String suppliedKey) private @Nullable StringparseTokenInAuthorizationHeader(io.netty.handler.codec.http.HttpRequest request) private @Nullable StringparseTokenInSecWebsocketProtocolHeader(io.netty.handler.codec.http.HttpRequest request) performSecurityChecks(io.netty.handler.codec.http.HttpRequest request) private voidsendUnauthorizedResponse(io.netty.channel.ChannelHandlerContext context, String reason) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
LOGGER
private final org.slf4j.Logger LOGGER -
AUTHENTICATED_KEY
-
ATTR_WEBSOCKET_ALLOWED
-
SUBPROTOCOL_VALUE
- See Also:
-
SUBPROTOCOL_HEADER_PREFIX
- See Also:
-
BEARER_PREFIX
- See Also:
-
securityConfig
-
allowedOrigins
-
-
Constructor Details
-
AuthenticationHandler
-
-
Method Details
-
channelRead
-
write
-
performSecurityChecks
private AuthenticationHandler.SecurityCheckResult performSecurityChecks(io.netty.handler.codec.http.HttpRequest request) -
isAllowedOriginHeader
private boolean isAllowedOriginHeader(io.netty.handler.codec.http.HttpRequest request) -
parseTokenInAuthorizationHeader
private @Nullable String parseTokenInAuthorizationHeader(io.netty.handler.codec.http.HttpRequest request) -
parseTokenInSecWebsocketProtocolHeader
private @Nullable String parseTokenInSecWebsocketProtocolHeader(io.netty.handler.codec.http.HttpRequest request) -
isValidApiKey
-
getClientIp
-
sendUnauthorizedResponse
private void sendUnauthorizedResponse(io.netty.channel.ChannelHandlerContext context, String reason)
-