public class NeptuneNettyHttpSigV4Signer extends NeptuneSigV4SignerBase<io.netty.handler.codec.http.FullHttpRequest>
FullHttpRequests.NeptuneSigV4SignerBase.NeptuneSigV4Signature| Constructor and Description |
|---|
NeptuneNettyHttpSigV4Signer(String regionName,
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)
Create a V4 Signer for Netty HTTP requests.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
attachSignature(io.netty.handler.codec.http.FullHttpRequest request,
NeptuneSigV4SignerBase.NeptuneSigV4Signature signature)
Attach the signature provided in the signature object to the nativeRequest.
|
protected com.amazonaws.SignableRequest<?> |
toSignableRequest(io.netty.handler.codec.http.FullHttpRequest request)
Convert the native request into an AWS SDK
SignableRequest object which
can be used to perform signing. |
checkNotNull, convertToSignableRequest, extractParametersFromQueryString, signRequestpublic NeptuneNettyHttpSigV4Signer(String regionName, com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) throws NeptuneSigV4SignerException
regionName - name of the region for which the request is signedawsCredentialsProvider - the provider offering access to the credentials used for signing the requestNeptuneSigV4SignerException - in case initialization failsprotected com.amazonaws.SignableRequest<?> toSignableRequest(io.netty.handler.codec.http.FullHttpRequest request)
throws NeptuneSigV4SignerException
NeptuneSigV4SignerBaseSignableRequest object which
can be used to perform signing. This means that the information from the request relevant
for signing (such as request URI, query string, headers, etc.) need to be extracted from
the native request and mapped to a SignableRequest object, which is used internally
for the signing process.
Note that the signable request internally, during the signing process, adds a "Host" header. This may lead to problems if the original request has a host header with a name in different capitalization (e.g. "host"), leading to duplicate host headers and the signing process to fail. Hence, when using the API you need to make sure that there is either no host header in your original request or the host header uses the exact string "Host" as the header name. The easiest solution, if you have control over the native HTTP request, is to just leave out the host header when translating and create one when signing (the host header value will be part of the struct returned from the signing process).
toSignableRequest in class NeptuneSigV4SignerBase<io.netty.handler.codec.http.FullHttpRequest>request - the native HTTP requestSignableRequestNeptuneSigV4SignerException - in case something goes wrong during translationprotected void attachSignature(io.netty.handler.codec.http.FullHttpRequest request,
NeptuneSigV4SignerBase.NeptuneSigV4Signature signature)
throws NeptuneSigV4SignerException
NeptuneSigV4SignerBaseattachSignature in class NeptuneSigV4SignerBase<io.netty.handler.codec.http.FullHttpRequest>request - the native HTTP requestsignature - the signature information to attachNeptuneSigV4SignerException - in case something goes wrong during signing of the native request