Class SignatureV4
- Aws\Signature\SignatureV4 implements Aws\Signature\SignatureInterface uses Aws\Signature\SignatureTrait
- Namespace: Aws\Signature
- Link: http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
- Located at Signature/SignatureV4.php
Signature Version 4
Direct known subclasses
Methods Summary
- __construct ( string $service, string $region, array $options = [] )
-
signRequest ( Psr\Http\Message\RequestInterface $request, Aws\Credentials\CredentialsInterface $credentials, $signingService = null )
Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
-
presign ( Psr\Http\Message\RequestInterface $request, Aws\Credentials\CredentialsInterface $credentials, int|string|\DateTimeInterface $expires, array $options = [] )
Create a pre-signed request.
-
static
convertPostToGet ( Psr\Http\Message\RequestInterface $request, $additionalQueryParams = "" )
Converts a POST request to a GET request by moving POST fields into the query string.
Methods Details
__construct ( string $service, string $region, array $options = [] )
Parameters
string | $service | Service name to use when signing |
string | $region | Region name to use when signing |
array | $options = [] | Array of configuration options used when signing - unsigned-body: Flag to make request have unsigned payload. Unsigned body is used primarily for streaming requests. |
Psr\Http\Message\RequestInterface
signRequest (
Psr\Http\Message\RequestInterface
$request,
Aws\Credentials\CredentialsInterface
$credentials,
$signingService = null
)
Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
Parameters
Psr\Http\Message\RequestInterface |
$request | Request to sign |
Aws\Credentials\CredentialsInterface |
$credentials | Signing credentials |
$signingService = null |
Returns
Psr\Http\Message\RequestInterface Returns the modified request. |
Implementation of
Psr\Http\Message\RequestInterface
presign (
Psr\Http\Message\RequestInterface
$request,
Aws\Credentials\CredentialsInterface
$credentials,
integer|string|DateTimeInterface
$expires,
array
$options = []
)
Create a pre-signed request.
Parameters
Psr\Http\Message\RequestInterface |
$request | Request to sign |
Aws\Credentials\CredentialsInterface |
$credentials | Credentials used to sign |
integer|string|DateTimeInterface | $expires | 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. |
array | $options = [] |
Returns
Psr\Http\Message\RequestInterface |
Implementation of
static
Psr\Http\Message\RequestInterface
convertPostToGet (
Psr\Http\Message\RequestInterface
$request,
$additionalQueryParams = ""
)
Converts a POST request to a GET request by moving POST fields into the query string.
Useful for pre-signing query protocol requests.
Parameters
Psr\Http\Message\RequestInterface |
$request | Request to clone |
$additionalQueryParams = "" |
Returns
Psr\Http\Message\RequestInterface |
Exceptions
InvalidArgumentException if the method is not POST |
Constants summary
string |
ISO8601_BASIC
|
#
'Ymd\THis\Z'
|
string |
UNSIGNED_PAYLOAD
|
#
'UNSIGNED-PAYLOAD'
|
string |
AMZ_CONTENT_SHA256_HEADER
|
#
'X-Amz-Content-Sha256'
|