Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor middleware to use new operation::Response instead of http::Response<SdkBody> #635

Merged
merged 12 commits into from
Aug 6, 2021
Merged

Refactor middleware to use new operation::Response instead of http::Response<SdkBody> #635

merged 12 commits into from
Aug 6, 2021

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Aug 5, 2021

Motivation and Context

This is progress towards #121.

This change is needed to be able to support Event Streams, since we need to track the original request's signature through to the first streaming event, as event frames are recursively signed with the previous event's or top-level request's signature.

Description

  • Creates operation::Response which attaches a PropertyBag to an http::Response<SdkBody>.
  • Updates ParseHttpResponse's parse_unloaded to take an operation::Response instead of an http::Response<SdkBody> so that it has access to the property bag. This isn't needed for the signature propagation, but may be needed to track the Body::channel that's created when attaching the input event stream to the HTTP request.
  • Renames config/request methods on operation::Request to properties/http so that they're consistent with operation::Response, and so that config doesn't get confused with the top-level generated service Config.
  • Adds doc comments to operation::Request

Testing

  • cargo test, cargo clippy on rust-runtime and aws/rust-runtime
  • g codegen:test && g codegen-test:test && g aws:sdk:assemble
  • Manually built and ran the S3 ListBuckets example

Checklist

  • I have updated the CHANGELOG

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jdisanti jdisanti requested a review from rcoh August 5, 2021 19:28
Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

LGTM except doc comment

@jdisanti jdisanti merged commit 68984dc into smithy-lang:main Aug 6, 2021
@jdisanti jdisanti deleted the eventstream-response-bag branch August 6, 2021 18:14
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