Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 8 additions & 6 deletions aws/signer/v4/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,21 @@ func (nonSeeker) Read(p []byte) (n int, err error) {
return 0, io.EOF
}

// semiSeekable is a stream whose seeks succeed until its body has been read,
// then fail, to exercise a rewind failure while computing the payload hash.
type semiSeekable struct {
hasSeeked bool
read bool
}

func (s *semiSeekable) Seek(offset int64, whence int) (int64, error) {
if !s.hasSeeked {
s.hasSeeked = true
return 0, nil
if s.read {
return 0, fmt.Errorf("io seek error")
}
return 0, fmt.Errorf("io seek error")
return 0, nil
}

func (*semiSeekable) Read(p []byte) (n int, err error) {
func (s *semiSeekable) Read(p []byte) (n int, err error) {
s.read = true
return 0, io.EOF
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ public List<RuntimeClientPlugin> getClientPlugins() {
.isCommon(true)
.build(),

// Add ContentLengthMiddleware to operation stack
RuntimeClientPlugin.builder()
.operationPredicate((model, service, operation) ->
EventStreamIndex.of(model).getInputInfo(operation).isEmpty())
.registerMiddleware(
MiddlewareRegistrar.builder()
.resolvedFunction(buildPackageSymbol("addComputeContentLength"))
.build()
).build(),

// Add endpoint serialize middleware to operation stack
RuntimeClientPlugin.builder()
.registerMiddleware(MiddlewareRegistrar.builder()
Expand Down Expand Up @@ -274,15 +264,11 @@ public Writable getFuncBody() {

private Writable addMiddleware() {
return goTemplate("""
$D $D $D
$D $D
func addClientRequestID(stack *middleware.Stack) error {
return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)
}

func addComputeContentLength(stack *middleware.Stack) error {
return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", middleware.After)
}

func addRawResponseToMetadata(stack *middleware.Stack) error {
return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)
}
Expand All @@ -296,7 +282,7 @@ func addRecordResponseTiming(stack *middleware.Stack, options Options) error {
func addSpanRetryLoop(stack *middleware.Stack, options Options) error {
return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before)
}
""", SmithyGoDependency.SMITHY_MIDDLEWARE, AwsGoDependency.AWS_MIDDLEWARE, SmithyGoDependency.SMITHY_HTTP_TRANSPORT);
""", SmithyGoDependency.SMITHY_MIDDLEWARE, AwsGoDependency.AWS_MIDDLEWARE);
}

private Writable addSigV4XMiddleware() {
Expand Down
4 changes: 0 additions & 4 deletions internal/kitchensinktest/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktest/api_op_GetItem.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktest/api_op_PutCompressedData.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktest/api_op_SubscribeEvents.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
400
Content-Type: application/x-amz-json-1.0
X-Amz-Target: AwsJson1KitchenSink.GetItem
X-Amzn-Errortype: ItemNotFound

{}
{"__type":"ItemNotFound"}
1 change: 0 additions & 1 deletion internal/kitchensinktest/snapshot/api_op_GetItem.go.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ GetItem
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ PutCompressedData
RequestCompression
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SubscribeEvents
Build stack step
EventStreamBuildMiddleware
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
4 changes: 0 additions & 4 deletions internal/kitchensinktestcbor/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestcbor/api_op_CborGetItem.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Accept: application/cbor
Content-Type: application/cbor
Smithy-Protocol: rpc-v2-cbor

¡f__typepCborItemNotFound
¿f__typepCborItemNotFoundÿ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CborGetItem
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CborPutCompressedData
RequestCompression
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
4 changes: 0 additions & 4 deletions internal/kitchensinktestcborlegacy/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestcborlegacy/api_op_CborGetItem.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CborGetItem
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CborPutCompressedData
RequestCompression
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
4 changes: 0 additions & 4 deletions internal/kitchensinktestlegacy/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestlegacy/api_op_GetItem.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestlegacy/api_op_PutCompressedData.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestlegacy/api_op_SubscribeEvents.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ GetItem
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ PutCompressedData
RequestCompression
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SubscribeEvents
Build stack step
EventStreamBuildMiddleware
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
4 changes: 0 additions & 4 deletions internal/kitchensinktestrestjson/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestrestjson/api_op_GetResource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/kitchensinktestrestjson/api_op_SubscribeEvents.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
200
Content-Type: application/octet-stream

__Body__
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
404
X-Amzn-Errortype: ResourceNotFound

{"__type":"ResourceNotFound"}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ GetResource
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ GetStreamingResource
OperationSerializer
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ PutCompressedData
RequestCompression
Build stack step
ClientRequestID
ComputeContentLength
SetCredentialSourceMiddleware
UserAgent
RecursionDetection
Expand Down
Loading
Loading