Unverified Commit b5f53bed authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

remove: default features from runtime crates (#935)



* remove: default features from runtime crates
update: tests and examples broken by default feature change
update: code generation broken by default feature change
fix: follow lint suggestion to lowercase variable names

* update: CHANGELOG.next.toml

* fix: add missing feature
fix: typo
formatting: sort imports

* update: make SDK changelog less worrying for SDK users not depending on a runtime crate
update: undo default feature change for SDK
fix: tests broken by default feature change
fix: examples broken by default feature change

* remove: empty defaults
add: doc w/ feature grid to aws-smithy-client
add: doc w/ feature grid to aws-smithy-http

* add: upgrade helper table to changelog
undo: bad formatting
formatting: add backticks to feature names in doc table

* remove: bytestream-util feature usage where possible
formatting: update CHANGELOG.next.toml

* remove: the client feature from generated SDKs
rename: feature "bytestream-util" to "rt-tokio"
update: mark "tower" dep as non-optional in SDKs
docs: update aws-smithy-http docs and README.md

* Update CHANGELOG.next.toml

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* Update rust-runtime/aws-smithy-http/README.md

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* revert: aws-sigv4 changes
update: CHANGELOG.next.toml
remove: rt-tokio dep feature for aws-smithy-async usage in aws-types

* fix: don't gate entire byte_stream module on rt-tokio feature
fix: typos

* remove: rt-tokio feature from SDKs generated with EventStreamSymbolProvider.kt
fix: incorrect doc comment

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
parent 4073ebab
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
@@ -29,6 +29,40 @@ references = ["aws-sdk-rust#317", "smithy-rs#907"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"

[[aws-sdk-rust]]
message = '''
If you directly depend on AWS or Smithy runtime crates _(e.g., AWS crates not named `aws-config` or prefixed with `aws-sdk-`)_,
the formerly default features from those crates must now be explicitly set in your `Cargo.toml`.


**Upgrade guide**

| before                          | after |
|---------------------------------|-------|
| `aws-smithy-async = "VERSION"`  | `aws-smithy-async = { version = "VERSION", features = ["rt-tokio"] }` |
| `aws-smithy-client = "VERSION"` | `aws-smithy-client = { version = "VERSION", features = ["client-hyper", "rustls", "rt-tokio"] }` |
| `aws-smithy-http = "VERSION"`   | `aws-smithy-http = { version = "VERSION", features = ["rt-tokio"] }` |
'''
references = ["smithy-rs#930"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "zhessler"

[[smithy-rs]]
message = '''
Runtime crates no longer have default features. You must now specify the features that you want when you add a dependency to your `Cargo.toml`.

**Upgrade guide**

| before                          | after |
|---------------------------------|-------|
| `aws-smithy-async = "VERSION"`  | `aws-smithy-async = { version = "VERSION", features = ["rt-tokio"] }` |
| `aws-smithy-client = "VERSION"` | `aws-smithy-client = { version = "VERSION", features = ["client-hyper", "rustls", "rt-tokio"] }` |
| `aws-smithy-http = "VERSION"`   | `aws-smithy-http = { version = "VERSION", features = ["rt-tokio"] }` |
'''
references = ["smithy-rs#930"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "zhessler"

[[aws-sdk-rust]]
message = "Use provided `sleep_impl` for retries instead of using Tokio directly."
references = ["smithy-rs#923"]
+2 −2
Original line number Diff line number Diff line
@@ -12,11 +12,11 @@ repository = "https://github.com/awslabs/smithy-rs"
default-provider = ["profile", "imds", "meta", "sts", "environment", "http-provider"]
profile = ["sts", "web-identity-token", "meta", "environment", "imds", "http-provider"]
meta = ["tokio/sync"]
imds = ["profile", "aws-smithy-http", "aws-smithy-http-tower", "aws-smithy-json", "tower", "aws-http", "meta"]
imds = ["profile", "aws-smithy-http/rt-tokio", "aws-smithy-http-tower", "aws-smithy-json", "tower", "aws-http", "meta"]
environment = ["meta"]
sts = ["aws-sdk-sts", "aws-hyper"]
web-identity-token = ["sts", "profile"]
http-provider = ["aws-hyper", "aws-smithy-json", "aws-smithy-http", "tower", "tokio/sync"]
http-provider = ["aws-hyper", "aws-smithy-json", "aws-smithy-http/rt-tokio", "tower", "tokio/sync"]
tcp-connector = ["tokio/net", "tower"]

# SSO is not supported
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

[features]
default = []
native-tls = ["hyper-tls", "aws-smithy-client/native-tls"]
rustls = ["hyper-rustls", "aws-smithy-client/rustls"]

+6 −7
Original line number Diff line number Diff line
@@ -3,15 +3,14 @@
 * SPDX-License-Identifier: Apache-2.0.
 */

use aws_sig_auth::signer::SignableBody;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_http::byte_stream::{self, ByteStream};
use aws_smithy_http::operation::Request;

use bytes::Buf;
use bytes_utils::SegmentedBuf;
use http::header::HeaderName;

use aws_sig_auth::signer::SignableBody;
use aws_smithy_http::byte_stream;
use aws_smithy_http::operation::Request;
use ring::digest::{Context, Digest, SHA256};
use tokio_stream::StreamExt;

@@ -30,9 +29,9 @@ const X_AMZ_CONTENT_SHA256: &str = "x-amz-content-sha256";
///
/// See <https://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html> for more information.
pub async fn add_checksum_treehash(request: &mut Request) -> Result<(), byte_stream::Error> {
    let clonable = request.http().body().try_clone();
    let cloneable = request.http().body().try_clone();
    let http_request = request.http_mut();
    let body_to_process = if let Some(cloned_body) = clonable {
    let body_to_process = if let Some(cloned_body) = cloneable {
        // we can stream the body
        cloned_body
    } else {
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ repository = "https://github.com/awslabs/smithy-rs"

[features]
sign-eventstream = ["aws-smithy-eventstream", "aws-sigv4/sign-eventstream"]
default = []

[dependencies]
aws-sigv4 = { path = "../aws-sigv4" }
Loading