Skip to content

Commit

Permalink
feat: Add retry information headers (#1432)
Browse files Browse the repository at this point in the history
* Update codegen tests to have .withSocketTimeout addition.

* Add Date header to mocked response; needed for retry middleware.

---------

Co-authored-by: Sichan Yoo <chanyoo@amazon.com>
  • Loading branch information
sichanyoo and Sichan Yoo authored Apr 16, 2024
1 parent 9b40607 commit 5847f55
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class MockHttpClientEngine: HTTPClient {
<HostId>WWoZlnK4pTjKCYn6eNV7GgOurabfqLkjbSyqTvDMGBaI9uwzyNhSaDhOCPs8paFGye7S6b/AB3A=</HostId>
</Error>
"""
request.withHeader(name: "Date", value: "Wed, 21 Oct 2015 07:28:00 GMT")
return HttpResponse(
headers: request.headers,
body: ByteStream.data(errorResponsePayload.data(using: .utf8)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ extension EventStreamTestClientTypes.TestStream: ClientRuntime.MessageUnmarshall
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a")
.withRegion(value: config.region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extension GetFooInput {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withFlowType(value: .PRESIGN_REQUEST)
.withExpiration(value: expiration)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
Expand Down Expand Up @@ -91,6 +92,7 @@ extension PostFooInput {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withFlowType(value: .PRESIGN_REQUEST)
.withExpiration(value: expiration)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
Expand Down Expand Up @@ -151,6 +153,7 @@ extension PutFooInput {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withFlowType(value: .PRESIGN_REQUEST)
.withExpiration(value: expiration)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
Expand Down Expand Up @@ -209,6 +212,7 @@ extension PutObjectInput {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withFlowType(value: .PRESIGN_REQUEST)
.withExpiration(value: expiration)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AWSQueryOperationStackTest {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a")
.withRegion(value: config.region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extension ChecksumTestsClient {
.withAuthSchemes(value: config.authSchemes ?? [])
.withAuthSchemeResolver(value: config.authSchemeResolver)
.withUnsignedPayloadTrait(value: false)
.withSocketTimeout(value: config.httpClientConfiguration.socketTimeout)
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4")
.withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a")
.withRegion(value: config.region)
Expand Down

0 comments on commit 5847f55

Please sign in to comment.