Class ControlPlaneWebSocketUpgradeGate
java.lang.Object
org.mockserver.netty.websocketregistry.ControlPlaneWebSocketUpgradeGate
The checks every control-plane WebSocket upgrade (
/_mockserver_ui_websocket and
/_mockserver_callback_websocket) must pass before it is upgraded: the browser
Origin must be allowed by CORSOriginPolicy, and the control-plane
authentication, when configured, must allow the request. A rejected upgrade gets a
403 (origin or role) or 401 (credentials) and the connection is closed.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe caller of an admitted upgrade: whether control-plane authentication admitted it and, when its authentication handler can name one, the caller's identity. -
Method Summary
Modifier and TypeMethodDescriptionadmitUpgrade(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest httpRequest, org.mockserver.mock.HttpState httpState, org.mockserver.logging.MockServerLogger mockServerLogger, boolean sslEnabledUpstream, String description) static booleanallowUpgrade(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest httpRequest, org.mockserver.mock.HttpState httpState, org.mockserver.logging.MockServerLogger mockServerLogger, boolean sslEnabledUpstream, String description)
-
Method Details
-
allowUpgrade
public static boolean allowUpgrade(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest httpRequest, org.mockserver.mock.HttpState httpState, org.mockserver.logging.MockServerLogger mockServerLogger, boolean sslEnabledUpstream, String description) - Parameters:
description- names the socket in the rejection log, e.g. "dashboard UI"- Returns:
- true when the upgrade may proceed; false once the rejection has been written
-
admitUpgrade
public static ControlPlaneWebSocketUpgradeGate.Admission admitUpgrade(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest httpRequest, org.mockserver.mock.HttpState httpState, org.mockserver.logging.MockServerLogger mockServerLogger, boolean sslEnabledUpstream, String description) - Parameters:
description- names the socket in the rejection log, e.g. "dashboard UI"- Returns:
- the admitted caller when the upgrade may proceed; null once the rejection has been written
-