| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dudlewebs\WPMCS\s3\Aws\Signature; |
| 4 |
|
| 5 |
use Dudlewebs\WPMCS\s3\Aws\Credentials\CredentialsInterface; |
| 6 |
use Dudlewebs\WPMCS\s3\Psr\Http\Message\RequestInterface; |
| 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(RequestInterface $request, CredentialsInterface $credentials); |
| 24 |
/** |
| 25 |
* Create a pre-signed request. |
| 26 |
* |
| 27 |
* @param RequestInterface $request Request to sign |
| 28 |
* @param CredentialsInterface $credentials Credentials used to sign |
| 29 |
* @param int|string|\DateTimeInterface $expires The time at which the URL should |
| 30 |
* expire. This can be a Unix timestamp, a PHP DateTime object, or a |
| 31 |
* string that can be evaluated by strtotime. |
| 32 |
* |
| 33 |
* @return RequestInterface |
| 34 |
*/ |
| 35 |
public function presign(RequestInterface $request, CredentialsInterface $credentials, $expires, array $options = []); |
| 36 |
} |
| 37 |
|