Skip to content

Conversation

@ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Nov 5, 2025

Motivation and Context

This PR breaks up RequestChecksumInterceptor into two interceptors: RequestChecksumInterceptor and AwsChunkedContentEncodingInterceptor with additional code restructuring to support the upcoming aws-chunked content encoding enhancement.

Description

RequestChecksumInterceptor previously handled two distinct responsibilities:

  1. Adding checksums (body or trailer)
  2. Applying aws-chunked content encoding

This refactor extracts the second responsibility (aws-chunked logic) into AwsChunkedContentEncodingInterceptor, aiming to enable it via the dedicated trait when available in Smithy.

In addition, both interceptors now wrap bodies in modify_before_transmit instead of modify_before_signing per design requirements.

Tips for merging to feature/http-1.x

This refactor reluctantly adds http_0x constructs that will conflict with feature/http-1.x. Update these files when merging:

  • aws-inlineable/src/http_request_checksum.rs - Apply same 1.x updates as done in branch (note: test_checksum_body_is_retryable was removed as it tested a utility only used in streaming cases against non-streaming bodies)
  • aws-inlineable/src/aws_chunked.rs - Use 1.x for header names, values, and body trait methods in unit tests, as in http_request_checksum.rs
  • aws/rust-runtime/aws-runtime/src/content_encoding.rs - Needs 1.x updates
    fn size_hint(&self) -> http_body_1x::SizeHint {
        http_body_1x::SizeHint::with_exact(self.encoded_length())
    }

to

    fn size_hint(&self) -> http_body_1x::SizeHint {
        http_body_1x::SizeHint::with_exact(self.options.encoded_length())
    }

because the .encoded_length() method has been moved from AwsChunkedBody to AwsChunkedBodyOptions (due to the content-length header needing encoded length during signing but body creation deferred to
modify_before_transmit)

Testing

  • CI

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ysaito1001 ysaito1001 requested review from a team as code owners November 5, 2025 22:02
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Contributor

@landonxjames landonxjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few questions, but no blockers

@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@ysaito1001 ysaito1001 merged commit d0dede7 into main Nov 10, 2025
50 checks passed
@ysaito1001 ysaito1001 deleted the ysaito/refactor-http-request-chunksum-interceptor branch November 10, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants