Unverified Commit 8873666b authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Add http = "1.0" support to the `http` request wrapper (#3373)



## Motivation and Context
- aws-sdk-rust#977
- smithy-rs#3365

## Description
Add `try_from` and `try_into` for HTTP 1.x to the HTTP request/response
wrapper. This is a stepping stone en route to supporting Hyper 1.0

## Testing
- [x] New unit tests

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

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

---------

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
parent e239b46a
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -10,3 +10,21 @@
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"

[[aws-sdk-rust]]
message = "The types in the aws-http crate were moved into aws-runtime. Deprecated type aliases were put in place to point to the new locations."
references = ["smithy-rs#3355"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
message = "Add `try_into_http1x` and `try_from_http1x` to Request and Response container types."
references = ["aws-sdk-rust#977", "smithy-rs#3365", "smithy-rs#3373"]
meta = { "breaking" = false, "bug" = false, "tada" = false, "target" = "all" }
author = "rcoh"

[[aws-sdk-rust]]
message = "Add `try_into_http1x` and `try_from_http1x` to Request and Response container types."
references = ["aws-sdk-rust#977", "smithy-rs#3365", "smithy-rs#3373"]
meta = { "breaking" = false, "bug" = false, "tada" = false }
author = "rcoh"
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ impl TestEnvironment {
            .await
        {
            Ok(()) => {}
            Err(e) => panic!("{}", e),
            Err(e) => panic!("{}", DisplayErrorContext(e.as_ref())),
        }
        let contents = rx.contents();
        let leaking_lines = self.lines_with_secrets(&contents);
+3 −1
Original line number Diff line number Diff line
@@ -13,14 +13,16 @@ repository = "https://github.com/smithy-lang/smithy-rs"
default = []
client = []
http-auth = ["dep:zeroize"]
test-util = ["aws-smithy-types/test-util"]
test-util = ["aws-smithy-types/test-util", "http-1x"]
http-02x = []
http-1x = []

[dependencies]
aws-smithy-async = { path = "../aws-smithy-async" }
aws-smithy-types = { path = "../aws-smithy-types" }
bytes = "1"
http = "0.2.9"
http1 = { package = "http", version = "1" }
pin-project-lite = "0.2"
tokio = { version = "1.25", features = ["sync"] }
tracing = "0.1"
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
//! HTTP request and response types

mod error;
mod extensions;
mod headers;
mod request;
mod response;
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,11 @@ impl HttpError {
        HttpError(err.into())
    }

    #[allow(dead_code)]
    pub(super) fn invalid_extensions() -> Self {
        Self("Extensions were provided during initialization. This prevents the request format from being converted.".into())
    }

    pub(super) fn invalid_header_value(err: InvalidHeaderValue) -> Self {
        Self(err.into())
    }
Loading