S3Signature
in package
implements
S3SignatureInterface
Default Amazon S3 signature implementation
Tags
Table of Contents
Interfaces
- S3SignatureInterface
- Interface used to provide interchangeable strategies for signing requests using the various AWS signature protocols.
Properties
- $signableQueryString : array<string|int, mixed>
- $signableHeaders : array<string|int, mixed>
Methods
- createCanonicalizedString() : mixed
- createPresignedUrl() : string
- Create a pre-signed URL
- signRequest() : mixed
- Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
- signString() : mixed
- createCanonicalizedAmzHeaders() : string
- Create a canonicalized AmzHeaders string for a signature.
- createCanonicalizedResource() : string
- Create a canonicalized resource for a request
- parseBucketName() : string
- Parse the bucket name from a request object
Properties
$signableQueryString
protected
array<string|int, mixed>
$signableQueryString
= array('acl', 'cors', 'delete', 'lifecycle', 'location', 'logging', 'notification', 'partNumber', 'policy', 'requestPayment', 'response-cache-control', 'response-content-disposition', 'response-content-encoding', 'response-content-language', 'response-content-type', 'response-expires', 'restore', 'tagging', 'torrent', 'uploadId', 'uploads', 'versionId', 'versioning', 'versions', 'website')
Query string values that must be signed
$signableHeaders
private
array<string|int, mixed>
$signableHeaders
= array('Content-MD5', 'Content-Type')
Sorted headers that must be signed
Methods
createCanonicalizedString()
public
createCanonicalizedString(RequestInterface $request[, mixed $expires = null ]) : mixed
Parameters
- $request : RequestInterface
- $expires : mixed = null
createPresignedUrl()
Create a pre-signed URL
public
createPresignedUrl(RequestInterface $request, CredentialsInterface $credentials, mixed $expires) : string
Parameters
- $request : RequestInterface
-
Request to sign
- $credentials : CredentialsInterface
-
Credentials used to sign
- $expires : mixed
-
The time at which the URL should expire. This can be a Unix timestamp, a PHP DateTime object, or a string that can be evaluated by strtotime
Return values
stringsignRequest()
Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
public
signRequest(RequestInterface $request, CredentialsInterface $credentials) : mixed
Parameters
- $request : RequestInterface
-
Request to add a signature to
- $credentials : CredentialsInterface
-
Signing credentials
signString()
public
signString(mixed $string, CredentialsInterface $credentials) : mixed
Parameters
- $string : mixed
- $credentials : CredentialsInterface
createCanonicalizedAmzHeaders()
Create a canonicalized AmzHeaders string for a signature.
private
createCanonicalizedAmzHeaders(RequestInterface $request) : string
Parameters
- $request : RequestInterface
-
Request from which to gather headers
Return values
string —Returns canonicalized AMZ headers.
createCanonicalizedResource()
Create a canonicalized resource for a request
private
createCanonicalizedResource(RequestInterface $request) : string
Parameters
- $request : RequestInterface
-
Request for the resource
Return values
stringparseBucketName()
Parse the bucket name from a request object
private
parseBucketName(RequestInterface $request) : string
Parameters
- $request : RequestInterface
-
Request to parse