public class S3Signer extends AbstractAWSSigner
Modifier and Type | Field and Description |
---|---|
private java.util.Set<java.lang.String> |
additionalQueryParamsToSign
The names of all the user-specified query parameters that should be
included in the canonical request, in addition to those default
parameters that are always signed.
|
private java.lang.String |
httpVerb
The HTTP verb (GET, PUT, HEAD, DELETE) the request to sign is using.
|
private static org.apache.commons.logging.Log |
log
Shared log for signing debug output
|
private java.lang.String |
resourcePath
The canonical resource path portion of the S3 string to sign.
|
EMPTY_STRING_SHA256_HEX
Constructor and Description |
---|
S3Signer()
Create a dummy instance of the S3Signer.
|
S3Signer(java.lang.String httpVerb,
java.lang.String resourcePath)
Constructs a new S3Signer to sign requests based on the AWS credentials,
HTTP method and canonical S3 resource path.
|
S3Signer(java.lang.String httpVerb,
java.lang.String resourcePath,
java.util.Collection<java.lang.String> additionalQueryParamsToSign)
Constructs a new S3Signer to sign requests based on the AWS credentials,
HTTP method and canonical S3 resource path.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSessionCredentials(SignableRequest<?> request,
AWSSessionCredentials credentials)
Adds session credentials to the request given.
|
void |
sign(SignableRequest<?> request,
AWSCredentials credentials)
Sign the given request with the given set of credentials.
|
getBinaryRequestPayload, getBinaryRequestPayloadStream, getBinaryRequestPayloadStreamWithoutQueryParams, getBinaryRequestPayloadWithoutQueryParams, getCanonicalizedEndpoint, getCanonicalizedQueryString, getCanonicalizedQueryString, getCanonicalizedResourcePath, getCanonicalizedResourcePath, getRequestPayload, getRequestPayloadWithoutQueryParams, getSignatureDate, getTimeOffset, hash, hash, hash, newString, sanitizeCredentials, sign, sign, signAndBase64Encode, signAndBase64Encode, signWithMac
private static final org.apache.commons.logging.Log log
private final java.lang.String httpVerb
private final java.lang.String resourcePath
private final java.util.Set<java.lang.String> additionalQueryParamsToSign
RestUtils#makeS3CanonicalString(String, String, Request, String)
public S3Signer()
public S3Signer(java.lang.String httpVerb, java.lang.String resourcePath)
httpVerb
- The HTTP verb (GET, PUT, POST, HEAD, DELETE) the request is
using.resourcePath
- The canonical S3 resource path (ex: "/", "/public S3Signer(java.lang.String httpVerb, java.lang.String resourcePath, java.util.Collection<java.lang.String> additionalQueryParamsToSign)
httpVerb
- The HTTP verb (GET, PUT, POST, HEAD, DELETE) the request is
using.resourcePath
- The canonical S3 resource path (ex: "/", "/additionalQueryParamsToSign
- A collection of user-specified query parameters that should be
included in the canonical request, in addition to those
default parameters that are always signed.RestUtils#makeS3CanonicalString(String, String, Request, String)
public void sign(SignableRequest<?> request, AWSCredentials credentials)
Signer
request
- The request to sign.credentials
- The credentials to sign the request with.protected void addSessionCredentials(SignableRequest<?> request, AWSSessionCredentials credentials)
AbstractAWSSigner
addSessionCredentials
in class AbstractAWSSigner
request
- The request to add session credentials information tocredentials
- The session credentials to add to the request