public interface AWSSignableRequest
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value)
Add a new header parameter required by the AWS Signature to the request to be sent.
|
AWSCredentials |
getCredentials()
Getter method to access the AWSCredential instance when the requet is being signed
|
Map<String,Object> |
getHeaders()
Getter method to access the request headers that needs to be included on the signature.
|
String |
getMethod()
Getter method to access the request http method
|
InputStream |
getPayload()
Getter method to access the request payload on signature generation time
|
long |
getTimeStamp()
Getter method to access the request timestamp to generate the signature
|
String |
getUrl()
Getter method to access the full request URL
|
void |
sign(String signingKey)
This method will be invoked from
AWSV4Signer.sign(AWSSignableRequest) to pass back the signing key that
needs to be included as the "Authorization" header into the original request. |
void addHeader(String name, String value)
getHeaders()
.name
- header parameter name required by AWS signaturevalue
- header parameter valueAWSCredentials getCredentials()
AWSCredentials
instance with the properties used to form the requestInputStream getPayload() throws IOException
InputStream
with the request body payloadIOException
- if there's a problem while reading the payloadString getMethod()
String
representation of the HTTP methodString getUrl()
String
representation of the request URLMap<String,Object> getHeaders()
Map
with the headers included on the request to be signedvoid sign(String signingKey)
AWSV4Signer.sign(AWSSignableRequest)
to pass back the signing key that
needs to be included as the "Authorization" header into the original request.
While calling addHeader("Authorization", signingKey); should be enough to implement this method for most of
http clients, it had to be isolated because some implementations like Restlet requires to use a different
mechanism to add these particular headers.long getTimeStamp()