Skip to content

Commit

Permalink
Merge branch 'main' into feat/support-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomourar authored Mar 22, 2023
2 parents bc4f686 + abbf78f commit d353ac3
Show file tree
Hide file tree
Showing 241 changed files with 17,279 additions and 14,002 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
required: false

env:
rust_version: 1.63.0
rust_version: 1.66.1
rust_toolchain_components: clippy,rustfmt
ENCRYPTED_DOCKER_PASSWORD: ${{ secrets.ENCRYPTED_DOCKER_PASSWORD }}
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claim-crate-names.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.63.0
rust_version: 1.66.1

name: Claim unpublished crate names on crates.io
run-name: ${{ github.workflow }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:

env:
java_version: 11
rust_version: 1.63.0
rust_version: 1.66.1
rust_toolchain_components: clippy,rustfmt
apt_dependencies: libssl-dev gnuplot jq

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.63.0
rust_version: 1.66.1

name: Release smithy-rs
run-name: ${{ github.workflow }} ${{ inputs.semantic_version }} (${{ inputs.commit_sha }}) - ${{ inputs.dry_run && 'Dry run' || 'Production run' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-sdk-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.63.0
toolchain: 1.66.1
- name: Delete old SDK
run: |
- name: Generate a fresh SDK
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ target/

# IDEs
.idea/
.project
.settings
.classpath

# tools
.tool-versions
45 changes: 44 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ references = ["smithy-rs#2448"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "jdisanti"


[[smithy-rs]]
message = "Fix bug in timestamp format resolution. Prior to this fix, the timestamp format may have been incorrect if set on the target instead of on the member."
references = ["smithy-rs#2226"]
Expand Down Expand Up @@ -326,3 +325,47 @@ be reused.
references = ["aws-sdk-rust#160", "smithy-rs#2445"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" }
author = "rcoh"

[[aws-sdk-rust]]
message = "Update MSRV to 1.66.1"
references = ["smithy-rs#2467"]
meta = { "breaking" = true, "tada" = true, "bug" = false }
author = "Velfi"

[[smithy-rs]]
message = "Update MSRV to 1.66.1"
references = ["smithy-rs#2467"]
meta = { "breaking" = true, "tada" = true, "bug" = false, "target" = "all" }
author = "Velfi"

[[aws-sdk-rust]]
message = """Default connector provided by `aws-config` now respects `ConnectorSettings`.
Previously, it used the timeout settings provided by aws-config. A test from @Oliboy50 has been incorporated to verify this behavior.
**Behavior Change**: Prior to this change, the Hyper client would be shared between all service clients. After this change, each service client will use its own Hyper Client.
To revert to the previous behavior, set `HttpConnector::Prebuilt` on `SdkConfig::http_connector`.
"""
references = ["smithy-rs#2471", "smithy-rs#2333", "smithy-rs#2151"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"

[[aws-sdk-rust]] # remove interfaces
message = """Remove deprecated `ResolveAwsEndpoint` interfaces.
[For details see the longform changelog entry](https://github.com/awslabs/aws-sdk-rust/discussions/755).
"""
author = "rcoh"
references = ["smithy-rs#2390", "smithy-rs#1784"]
meta = { "breaking" = true, "tada" = false, "bug" = false }

[[smithy-rs]] # tokio-upgrade
message = "Increase Tokio version to 1.23.1 for all crates. This is to address [RUSTSEC-2023-0001](https://rustsec.org/advisories/RUSTSEC-2023-0001)"
references = ["smithy-rs#2474"]
meta = { "breaking" = false, "tada" = false, "bug" = false, target = "all" }
author = "rcoh"

[[aws-sdk-rust]] # tokio-upgrade
message = "Increase Tokio version to 1.23.1 for all crates. This is to address [RUSTSEC-2023-0001](https://rustsec.org/advisories/RUSTSEC-2023-0001)"
references = ["smithy-rs#2474"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "rcoh"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Project Layout
* [`design`](design): Design documentation. See the [design/README.md](design/README.md) for details about building / viewing.
* `codegen-server`: Whitelabel Smithy server code generation
* `codegen-server-test`: Smithy protocol test generation & integration tests for Smithy server whitelabel code
* `examples`: A collection of server implementation examples

Testing
-------
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ aws-smithy-http-tower = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http-to
aws-smithy-json = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-json" }
aws-smithy-types = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-types" }
aws-types = { path = "../../sdk/build/aws-sdk/sdk/aws-types" }
hyper = { version = "0.14.12", default-features = false }
hyper = { version = "0.14.25", default-features = false }
time = { version = "0.3.4", features = ["parsing"] }
tokio = { version = "1.13.1", features = ["sync"] }
tracing = { version = "0.1" }
Expand All @@ -47,10 +47,10 @@ hex = { version = "0.4.3", optional = true }
zeroize = { version = "1", optional = true }

[dev-dependencies]
futures-util = "0.3.16"
futures-util = { version = "0.3.16", default-features = false }
tracing-test = "0.2.1"

tokio = { version = "1.8.4", features = ["full", "test-util"] }
tokio = { version = "1.23.1", features = ["full", "test-util"] }

# used for fuzzing profile parsing
arbitrary = "=1.1.3" # 1.1.4 requires Rust 1.63 to compile
Expand Down
1 change: 1 addition & 0 deletions aws/rust-runtime/aws-config/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub fn default_connector(
settings: &ConnectorSettings,
sleep: Option<Arc<dyn AsyncSleep>>,
) -> Option<DynConnector> {
tracing::trace!(settings = ?settings, sleep = ?sleep, "creating a new connector");
let hyper = base(settings, sleep).build(aws_smithy_client::conns::https());
Some(DynConnector::new(hyper))
}
Expand Down
5 changes: 2 additions & 3 deletions aws/rust-runtime/aws-config/src/imds/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,10 @@ mod test {
sleeper.sleep(std::time::Duration::from_millis(100)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match provider.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down
46 changes: 4 additions & 42 deletions aws/rust-runtime/aws-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ mod loader {
use aws_credential_types::cache::CredentialsCache;
use aws_credential_types::provider::{ProvideCredentials, SharedCredentialsProvider};
use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep};
use aws_smithy_client::http_connector::{ConnectorSettings, HttpConnector};
use aws_smithy_client::http_connector::HttpConnector;
use aws_smithy_types::retry::RetryConfig;
use aws_smithy_types::timeout::TimeoutConfig;
use aws_types::app_name::AppName;
use aws_types::docs_for;
use aws_types::endpoint::ResolveAwsEndpoint;
use aws_types::SdkConfig;

use crate::connector::default_connector;
Expand All @@ -182,7 +181,6 @@ mod loader {
app_name: Option<AppName>,
credentials_cache: Option<CredentialsCache>,
credentials_provider: Option<SharedCredentialsProvider>,
endpoint_resolver: Option<Arc<dyn ResolveAwsEndpoint>>,
endpoint_url: Option<String>,
region: Option<Box<dyn ProvideRegion>>,
retry_config: Option<RetryConfig>,
Expand Down Expand Up @@ -346,36 +344,6 @@ mod loader {
self
}

/// Override the endpoint resolver used for **all** AWS Services
///
/// This method is deprecated. Use [`Self::endpoint_url`] instead.
///
/// This method will override the endpoint resolver used for **all** AWS services. This mainly
/// exists to set a static endpoint for tools like `LocalStack`. For live traffic, AWS services
/// require the service-specific endpoint resolver they load by default.
///
/// # Examples
///
/// Use a static endpoint for all services
/// ```no_run
/// # async fn create_config() -> Result<(), aws_smithy_http::endpoint::error::InvalidEndpointError> {
/// use aws_config::endpoint::Endpoint;
///
/// let sdk_config = aws_config::from_env()
/// .endpoint_resolver(Endpoint::immutable("http://localhost:1234")?)
/// .load()
/// .await;
/// # Ok(())
/// # }
#[deprecated(note = "use `.endpoint_url(...)` instead")]
pub fn endpoint_resolver(
mut self,
endpoint_resolver: impl ResolveAwsEndpoint + 'static,
) -> Self {
self.endpoint_resolver = Some(Arc::new(endpoint_resolver));
self
}

/// Provides the ability to programmatically override the profile files that get loaded by the SDK.
///
/// The [`Default`] for `ProfileFiles` includes the default SDK config and credential files located in
Expand Down Expand Up @@ -571,12 +539,9 @@ mod loader {
.await
};

let http_connector = self.http_connector.unwrap_or_else(|| {
HttpConnector::Prebuilt(default_connector(
&ConnectorSettings::from_timeout_config(&timeout_config),
sleep_impl.clone(),
))
});
let http_connector = self
.http_connector
.unwrap_or_else(|| HttpConnector::ConnectorFn(Arc::new(default_connector)));

let credentials_cache = self.credentials_cache.unwrap_or_else(|| {
let mut builder = CredentialsCache::lazy_builder().time_source(conf.time_source());
Expand Down Expand Up @@ -604,8 +569,6 @@ mod loader {
SharedCredentialsProvider::new(builder.build().await)
};

let endpoint_resolver = self.endpoint_resolver;

let mut builder = SdkConfig::builder()
.region(region)
.retry_config(retry_config)
Expand All @@ -614,7 +577,6 @@ mod loader {
.credentials_provider(credentials_provider)
.http_connector(http_connector);

builder.set_endpoint_resolver(endpoint_resolver);
builder.set_app_name(app_name);
builder.set_sleep_impl(sleep_impl);
builder.set_endpoint_url(self.endpoint_url);
Expand Down
10 changes: 4 additions & 6 deletions aws/rust-runtime/aws-config/src/meta/credentials/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ mod tests {
tokio::time::sleep(Duration::from_millis(300)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match chain.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down Expand Up @@ -208,11 +207,10 @@ mod tests {
tokio::time::sleep(Duration::from_millis(100)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match chain.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down
8 changes: 4 additions & 4 deletions aws/rust-runtime/aws-config/src/profile/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ mod test {
fn flatten(profile: ProfileSet) -> HashMap<String, HashMap<String, String>> {
profile
.profiles
.into_iter()
.map(|(_name, profile)| {
.into_values()
.map(|profile| {
(
profile.name,
profile
.properties
.into_iter()
.map(|(_, prop)| (prop.key, prop.value))
.into_values()
.map(|prop| (prop.key, prop.value))
.collect(),
)
})
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/aws-config/src/profile/parser/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
// ~ is only expanded as a single component (currently)
let path = "~aws/config";
assert_eq!(
expand_home(&path, false, &None).to_str().unwrap(),
expand_home(path, false, &None).to_str().unwrap(),
"~aws/config"
);
}
Expand Down Expand Up @@ -336,7 +336,7 @@ mod tests {
fn test_expand_home() {
let path = "~/.aws/config";
assert_eq!(
expand_home(&path, false, &Some("/user/foo".to_string()))
expand_home(path, false, &Some("/user/foo".to_string()))
.to_str()
.unwrap(),
"/user/foo/.aws/config"
Expand Down Expand Up @@ -366,7 +366,7 @@ mod tests {
fn test_expand_home_windows() {
let path = "~/.aws/config";
assert_eq!(
expand_home(&path, true, &Some("C:\\Users\\name".to_string()),)
expand_home(path, true, &Some("C:\\Users\\name".to_string()),)
.to_str()
.unwrap(),
"C:\\Users\\name\\.aws\\config"
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-credential-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test-util = []
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
fastrand = "1.4.0"
tokio = { version = "1.8.4", features = ["sync"] }
tokio = { version = "1.23.1", features = ["sync"] }
tracing = "0.1"
zeroize = "1"

Expand All @@ -26,7 +26,7 @@ aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features =
async-trait = "0.1.51"
env_logger = "0.9.0"

tokio = { version = "1.8.4", features = ["full", "test-util", "rt"] }
tokio = { version = "1.23.1", features = ["full", "test-util", "rt"] }
tracing-test = "0.2.1"

[package.metadata.docs.rs]
Expand Down
Loading

0 comments on commit d353ac3

Please sign in to comment.