Class AwsSigV4ClientHandshaker
- java.lang.Object
-
- io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker
-
- io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13
-
- com.amazon.neptune.gremlin.driver.sigv4.AwsSigV4ClientHandshaker
-
public class AwsSigV4ClientHandshaker extends io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13Extends the functionality ofWebSocketClientHandshaker13by adding SIGV4 authentication headers to the request.
-
-
Constructor Summary
Constructors Constructor Description AwsSigV4ClientHandshaker(URI webSocketURL, io.netty.handler.codec.http.websocketx.WebSocketVersion version, String subprotocol, boolean allowExtensions, io.netty.handler.codec.http.HttpHeaders customHeaders, int maxFramePayloadLength, ChainedSigV4PropertiesProvider sigV4PropertiesProvider)Deprecated.AwsSigV4ClientHandshaker(URI webSocketURL, io.netty.handler.codec.http.websocketx.WebSocketVersion version, String subprotocol, boolean allowExtensions, io.netty.handler.codec.http.HttpHeaders customHeaders, int maxFramePayloadLength, ChainedSigV4PropertiesProvider sigV4PropertiesProvider, com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.netty.handler.codec.http.FullHttpRequestnewHandshakeRequest()Gets the request as generated byWebSocketClientHandshaker13and adds additional headers and a SIGV4 signature required for SigV4Auth.-
Methods inherited from class io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13
newWebsocketDecoder, newWebSocketEncoder, setForceCloseTimeoutMillis, verify
-
Methods inherited from class io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker
actualSubprotocol, close, close, expectedSubprotocol, finishHandshake, forceCloseTimeoutMillis, handshake, handshake, isForceCloseComplete, isHandshakeComplete, maxFramePayloadLength, processHandshake, processHandshake, upgradeUrl, uri, version
-
-
-
-
Constructor Detail
-
AwsSigV4ClientHandshaker
@Deprecated public AwsSigV4ClientHandshaker(URI webSocketURL, io.netty.handler.codec.http.websocketx.WebSocketVersion version, String subprotocol, boolean allowExtensions, io.netty.handler.codec.http.HttpHeaders customHeaders, int maxFramePayloadLength, ChainedSigV4PropertiesProvider sigV4PropertiesProvider)
Deprecated.Creates a new instance with default credentials provider (for backward compatibility).- Parameters:
webSocketURL- - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.version- - Version of web socket specification to use to connect to the serversubprotocol- - Sub protocol request sent to the server.allowExtensions- - Allow extensions to be used in the reserved bits of the web socket framecustomHeaders- - Map of custom headers to add to the client requestmaxFramePayloadLength- - Maximum length of a frame's payloadsigV4PropertiesProvider- - a properties provider to get sigV4 auth related properties
-
AwsSigV4ClientHandshaker
public AwsSigV4ClientHandshaker(URI webSocketURL, io.netty.handler.codec.http.websocketx.WebSocketVersion version, String subprotocol, boolean allowExtensions, io.netty.handler.codec.http.HttpHeaders customHeaders, int maxFramePayloadLength, ChainedSigV4PropertiesProvider sigV4PropertiesProvider, com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)
Creates a new instance.- Parameters:
webSocketURL- - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.version- - Version of web socket specification to use to connect to the serversubprotocol- - Sub protocol request sent to the server.allowExtensions- - Allow extensions to be used in the reserved bits of the web socket framecustomHeaders- - Map of custom headers to add to the client requestmaxFramePayloadLength- - Maximum length of a frame's payloadsigV4PropertiesProvider- - a properties provider to get sigV4 auth related propertiesawsCredentialsProvider- - an AWS credentials provider to use to generate signature
-
-
Method Detail
-
newHandshakeRequest
protected io.netty.handler.codec.http.FullHttpRequest newHandshakeRequest()
Gets the request as generated byWebSocketClientHandshaker13and adds additional headers and a SIGV4 signature required for SigV4Auth. Sends the opening request to the server: GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 x-amz-date: 20180214T002049Z Authorization: [SIGV4AuthHeader]- Overrides:
newHandshakeRequestin classio.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13- Returns:
- SIGV4 signed
FullHttpRequest.
-
-