| 1 | <?php |
| 2 | namespace Aws\Signature; |
| 3 | |
| 4 | use Aws\Credentials\CredentialsInterface; |
| 5 | use Psr\Http\Message\RequestInterface; |
| 6 | |
| 7 | /** |
| 8 | * Interface used to provide interchangeable strategies for signing requests |
| 9 | * using the various AWS signature protocols. |
| 10 | */ |
| 11 | interface SignatureInterface |
| 12 | { |
| 13 | /** |
| 14 | * Signs the specified request with an AWS signing protocol by using the |
| 15 | * provided AWS account credentials and adding the required headers to the |
| 16 | * request. |
| 17 | * |
| 18 | * @param RequestInterface $request Request to sign |
| 19 | * @param CredentialsInterface $credentials Signing credentials |
| 20 | * |
| 21 | * @return RequestInterface Returns the modified request. |
| 22 | */ |
| 23 | public function signRequest( |
| 24 | RequestInterface $request, |
| 25 | CredentialsInterface $credentials |
| 26 | ); |
| 27 | |
| 28 | /** |
| 29 | * Create a pre-signed request. |
| 30 | * |
| 31 | * @param RequestInterface $request Request to sign |
| 32 | * @param CredentialsInterface $credentials Credentials used to sign |
| 33 | * @param int|string|\DateTimeInterface $expires The time at which the URL should |
| 34 | * expire. This can be a Unix timestamp, a PHP DateTime object, or a |
| 35 | * string that can be evaluated by strtotime. |
| 36 | * |
| 37 | * @return RequestInterface |
| 38 | */ |
| 39 | public function presign( |
| 40 | RequestInterface $request, |
| 41 | CredentialsInterface $credentials, |
| 42 | $expires, |
| 43 | array $options = [] |
| 44 | ); |
| 45 | } |