Skip to content

Commit 6e400e2

Browse files
authored
PreSign request (#341)
* Draft PreSign request * Add documentation * Implement Presign in Signers * Regenerate Inputs * Refactor signer * Fix compare aligment * Add RequestContext * Add SDK tests * Typehint with DatetimeInterface * Remove presign override in s3 * Use memory first for RewindableFallback * Add comment on internal use of RewindableStream * Close stream and fix typehint * Fix treshold size
1 parent 3fd1725 commit 6e400e2

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/Input/AddLayerVersionPermissionRequest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace AsyncAws\Lambda\Input;
44

55
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
67
use AsyncAws\Core\Request;
78
use AsyncAws\Core\Stream\StreamFactory;
89

9-
class AddLayerVersionPermissionRequest
10+
class AddLayerVersionPermissionRequest implements Input
1011
{
1112
/**
1213
* The name or Amazon Resource Name (ARN) of the layer.

src/Input/InvocationRequest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace AsyncAws\Lambda\Input;
44

55
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
67
use AsyncAws\Core\Request;
78
use AsyncAws\Core\Stream\StreamFactory;
89
use AsyncAws\Lambda\Enum\InvocationType;
910
use AsyncAws\Lambda\Enum\LogType;
1011

11-
class InvocationRequest
12+
class InvocationRequest implements Input
1213
{
1314
/**
1415
* The name of the Lambda function, version, or alias.

src/Input/ListLayerVersionsRequest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
namespace AsyncAws\Lambda\Input;
44

55
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
67
use AsyncAws\Core\Request;
78
use AsyncAws\Core\Stream\StreamFactory;
89
use AsyncAws\Lambda\Enum\Runtime;
910

10-
class ListLayerVersionsRequest
11+
class ListLayerVersionsRequest implements Input
1112
{
1213
/**
1314
* A runtime identifier. For example, `go1.x`.

src/Input/PublishLayerVersionRequest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace AsyncAws\Lambda\Input;
44

55
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
67
use AsyncAws\Core\Request;
78
use AsyncAws\Core\Stream\StreamFactory;
89
use AsyncAws\Lambda\Enum\Runtime;
910
use AsyncAws\Lambda\ValueObject\LayerVersionContentInput;
1011

11-
class PublishLayerVersionRequest
12+
class PublishLayerVersionRequest implements Input
1213
{
1314
/**
1415
* The name or Amazon Resource Name (ARN) of the layer.

src/LambdaClient.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\Lambda;
44

55
use AsyncAws\Core\AbstractApi;
6+
use AsyncAws\Core\RequestContext;
67
use AsyncAws\Lambda\Input\AddLayerVersionPermissionRequest;
78
use AsyncAws\Lambda\Input\InvocationRequest;
89
use AsyncAws\Lambda\Input\ListLayerVersionsRequest;
@@ -34,7 +35,7 @@ class LambdaClient extends AbstractApi
3435
*/
3536
public function addLayerVersionPermission($input): AddLayerVersionPermissionResponse
3637
{
37-
$response = $this->getResponse(AddLayerVersionPermissionRequest::create($input)->request());
38+
$response = $this->getResponse(AddLayerVersionPermissionRequest::create($input)->request(), new RequestContext(['operation' => 'AddLayerVersionPermission']));
3839

3940
return new AddLayerVersionPermissionResponse($response);
4041
}
@@ -56,7 +57,7 @@ public function addLayerVersionPermission($input): AddLayerVersionPermissionResp
5657
*/
5758
public function invoke($input): InvocationResponse
5859
{
59-
$response = $this->getResponse(InvocationRequest::create($input)->request());
60+
$response = $this->getResponse(InvocationRequest::create($input)->request(), new RequestContext(['operation' => 'Invoke']));
6061

6162
return new InvocationResponse($response);
6263
}
@@ -79,7 +80,7 @@ public function invoke($input): InvocationResponse
7980
public function listLayerVersions($input): ListLayerVersionsResponse
8081
{
8182
$input = ListLayerVersionsRequest::create($input);
82-
$response = $this->getResponse($input->request());
83+
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListLayerVersions']));
8384

8485
return new ListLayerVersionsResponse($response, $this, $input);
8586
}
@@ -101,7 +102,7 @@ public function listLayerVersions($input): ListLayerVersionsResponse
101102
*/
102103
public function publishLayerVersion($input): PublishLayerVersionResponse
103104
{
104-
$response = $this->getResponse(PublishLayerVersionRequest::create($input)->request());
105+
$response = $this->getResponse(PublishLayerVersionRequest::create($input)->request(), new RequestContext(['operation' => 'PublishLayerVersion']));
105106

106107
return new PublishLayerVersionResponse($response);
107108
}

0 commit comments

Comments
 (0)