From 9b5a66a86815ed8e36cc93ceef14d6c4d7f2df47 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 10:02:34 +0100 Subject: [PATCH 01/21] add copy/clone trait impl --- lambda-runtime/src/layers/otel.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lambda-runtime/src/layers/otel.rs b/lambda-runtime/src/layers/otel.rs index f50f36f7..5598d745 100644 --- a/lambda-runtime/src/layers/otel.rs +++ b/lambda-runtime/src/layers/otel.rs @@ -8,6 +8,7 @@ use tracing::{field, instrument::Instrumented, Instrument}; /// Tower layer to add OpenTelemetry tracing to a Lambda function invocation. The layer accepts /// a function to flush OpenTelemetry after the end of the invocation. +#[derive(Copy, Clone)] pub struct OpenTelemetryLayer { flush_fn: F, otel_attribute_trigger: OpenTelemetryFaasTrigger, From 6931140113d3d79a4f892c45d4f686d9447300e0 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 12:36:21 +0100 Subject: [PATCH 02/21] update all deps and fix examples --- Cargo.toml | 10 +++--- .../Cargo.toml | 6 ++-- .../consumer/Cargo.toml | 6 ++-- .../pizza_lib/Cargo.toml | 2 +- .../producer/Cargo.toml | 10 +++--- .../Cargo.toml | 2 +- .../Cargo.toml | 4 +-- .../Cargo.toml | 2 +- examples/basic-error-handling/Cargo.toml | 6 ++-- examples/basic-error-thiserror/Cargo.toml | 2 +- .../basic-lambda-external-runtime/Cargo.toml | 10 +++--- examples/basic-lambda/Cargo.toml | 4 +-- .../Cargo.toml | 21 +++++------ .../src/main.rs | 9 +++-- .../src/s3.rs | 19 +++++----- examples/basic-s3-thumbnail/Cargo.toml | 14 ++++---- examples/basic-s3-thumbnail/src/main.rs | 6 ++-- examples/basic-s3-thumbnail/src/s3.rs | 4 +-- examples/basic-sdk/Cargo.toml | 10 +++--- examples/basic-sdk/src/main.rs | 7 ++-- examples/basic-shared-resource/Cargo.toml | 2 +- examples/basic-sqs/Cargo.toml | 2 +- examples/extension-basic/Cargo.toml | 2 +- examples/extension-combined/Cargo.toml | 2 +- examples/extension-custom-events/Cargo.toml | 2 +- examples/extension-custom-service/Cargo.toml | 2 +- examples/extension-internal-flush/Cargo.toml | 2 +- examples/extension-logs-basic/Cargo.toml | 2 +- .../extension-logs-custom-service/Cargo.toml | 2 +- .../Cargo.toml | 6 ++-- .../src/main.rs | 11 ++++-- examples/extension-telemetry-basic/Cargo.toml | 2 +- .../http-axum-apigw-authorizer/Cargo.toml | 2 +- examples/http-axum-diesel-ssl/Cargo.toml | 19 +++++----- examples/http-axum-diesel-ssl/src/main.rs | 35 +++++++++---------- examples/http-axum-diesel/Cargo.toml | 7 ++-- examples/http-axum-diesel/src/main.rs | 8 +++-- examples/http-axum/Cargo.toml | 2 +- examples/http-cors/Cargo.toml | 2 +- examples/http-dynamodb/Cargo.toml | 14 ++++---- examples/http-dynamodb/src/main.rs | 30 +++++++--------- examples/http-tower-trace/Cargo.toml | 4 +-- examples/lambda-rds-iam-auth/Cargo.toml | 14 ++++---- examples/opentelemetry-tracing/Cargo.toml | 10 +++--- lambda-events/Cargo.toml | 4 +-- lambda-extension/Cargo.toml | 4 +-- lambda-http/Cargo.toml | 12 +++---- lambda-integration-tests/Cargo.toml | 6 ++-- lambda-runtime-api-client/Cargo.toml | 2 +- lambda-runtime/Cargo.toml | 10 +++--- 50 files changed, 186 insertions(+), 190 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 867e9c0d..373eae1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["examples"] [workspace.dependencies] base64 = "0.22" bytes = "1" -chrono = { version = "0.4.35", default-features = false, features = [ +chrono = { version = "0.4.39", default-features = false, features = [ "clock", "serde", "std", @@ -22,12 +22,12 @@ chrono = { version = "0.4.35", default-features = false, features = [ futures = "0.3" futures-channel = "0.3" futures-util = "0.3" -http = "1.0" +http = "1.2" http-body = "1.0" http-body-util = "0.1" -http-serde = "2.0" -hyper = "1.0" -hyper-util = "0.1.1" +http-serde = "2.1" +hyper = "1.5" +hyper-util = "0.1.10" pin-project-lite = "0.2" tower = "0.5" tower-layer = "0.3" diff --git a/examples/advanced-appconfig-feature-flags/Cargo.toml b/examples/advanced-appconfig-feature-flags/Cargo.toml index 52ebb843..e19bd3ea 100644 --- a/examples/advanced-appconfig-feature-flags/Cargo.toml +++ b/examples/advanced-appconfig-feature-flags/Cargo.toml @@ -15,10 +15,10 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.85" lambda_runtime = "0.13" -reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -thiserror = "1.0" +thiserror = "2.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 69ec04a0..5a03daa6 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] #aws dependencies -aws-sdk-config = "0.35.0" -aws-sdk-sqs = "0.35.0" -aws_lambda_events = { version = "0.11.1", features = ["sqs"], default-features = false } +aws-sdk-config = "1.57.0" +aws-sdk-sqs = "1.54.0" +aws_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false } #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml index 76631bbd..17486621 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -serde = { version = "1.0.191", features = ["derive"] } +serde = { version = "1.0.217", features = ["derive"] } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 83aa48ab..8c2061db 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -8,14 +8,14 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies -aws-config = "0.57.1" -aws-sdk-config = "0.35.0" -aws-sdk-sqs = "0.35.0" +aws-config = "1.5.14" +aws-sdk-config = "1.57.0" +aws-sdk-sqs = "1.54.0" #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } -serde_json = "1.0.108" +serde_json = "1.0.137" tokio = { version = "1", features = ["macros"] } #shared lib -pizza_lib = { path = "../pizza_lib" } \ No newline at end of file +pizza_lib = { path = "../pizza_lib" } diff --git a/examples/advanced-sqs-partial-batch-failures/Cargo.toml b/examples/advanced-sqs-partial-batch-failures/Cargo.toml index 95050b9a..5f89f606 100644 --- a/examples/advanced-sqs-partial-batch-failures/Cargo.toml +++ b/examples/advanced-sqs-partial-batch-failures/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] serde = "^1" serde_derive = "^1" -serde_with = { version = "^2", features = ["json"], optional = true } +serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-cognito-post-confirmation/Cargo.toml b/examples/basic-cognito-post-confirmation/Cargo.toml index 7d2e7ab4..de6b8085 100644 --- a/examples/basic-cognito-post-confirmation/Cargo.toml +++ b/examples/basic-cognito-post-confirmation/Cargo.toml @@ -15,8 +15,8 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws-config = "1.5.0" -aws-sdk-ses = "1.28.0" +aws-config = "1.5.14" +aws-sdk-ses = "1.57.0" aws_lambda_events = { path = "../../lambda-events", default-features = false, features = ["cognito"] } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-error-error-crates-integration/Cargo.toml b/examples/basic-error-error-crates-integration/Cargo.toml index 741ec713..ccc62403 100644 --- a/examples/basic-error-error-crates-integration/Cargo.toml +++ b/examples/basic-error-error-crates-integration/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" anyhow = "1" eyre = "0.6.12" lambda_runtime = { path = "../../lambda-runtime", features = ["anyhow", "eyre", "miette"] } -miette = "7.2.0" +miette = "7.4.0" serde = "1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-error-handling/Cargo.toml b/examples/basic-error-handling/Cargo.toml index 1039a139..55da8395 100644 --- a/examples/basic-error-handling/Cargo.toml +++ b/examples/basic-error-handling/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" -serde_json = "1.0.81" -simple-error = "0.2.3" +serde = "1.0.217" +serde_json = "1.0.137" +simple-error = "0.3.1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-error-thiserror/Cargo.toml b/examples/basic-error-thiserror/Cargo.toml index d7c7d725..f2b0b449 100644 --- a/examples/basic-error-thiserror/Cargo.toml +++ b/examples/basic-error-thiserror/Cargo.toml @@ -18,5 +18,5 @@ edition = "2021" lambda_runtime = { path = "../../lambda-runtime" } serde = "1" -thiserror = "1.0.61" +thiserror = "2.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-lambda-external-runtime/Cargo.toml b/examples/basic-lambda-external-runtime/Cargo.toml index d6d023d8..7a7af473 100644 --- a/examples/basic-lambda-external-runtime/Cargo.toml +++ b/examples/basic-lambda-external-runtime/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -async-channel = "1.8.0" -futures-lite = "1.13.0" +async-channel = "2.3.1" +futures-lite = "2.6.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.163" -tokio = "1.28.2" +serde = "1.0.217" +tokio = "1.43.0" [dev-dependencies] -tokio-test = "0.4.2" +tokio-test = "0.4.4" diff --git a/examples/basic-lambda/Cargo.toml b/examples/basic-lambda/Cargo.toml index 6fad6990..6e74e4ef 100644 --- a/examples/basic-lambda/Cargo.toml +++ b/examples/basic-lambda/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } [dev-dependencies] -tokio-test = "0.4.2" \ No newline at end of file +tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index 905362c9..ad40a9e2 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -15,19 +15,20 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws_lambda_events = "0.8.3" +aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1" tokio = { version = "1", features = ["macros"] } -aws-config = "0.55.3" -aws-sdk-s3 = "0.28.0" +aws-config = "1.5.14" +aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" -mime = "0.3.16" -async-trait = "0.1.66" -ureq = "2.6.2" -aws-smithy-http = "0.55.3" -webp = "=0.2.1" +mime = "0.3.17" +async-trait = "0.1.85" +ureq = "2.12.1" +aws-smithy-http = "0.60.12" +webp = "=0.3.0" [dev-dependencies] -mockall = "0.11.3" -tokio-test = "0.4.2" +serde_json = "1.0.137" +mockall = "0.13.1" +tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index bb1c4f9c..90cfeec9 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -90,24 +90,23 @@ mod tests { use aws_lambda_events::s3::object_lambda::ListObjectsV2Context; use aws_lambda_events::s3::object_lambda::UserIdentity; use aws_lambda_events::s3::object_lambda::UserRequest; - use aws_lambda_events::serde_json::json; use lambda_runtime::{Context, LambdaEvent}; use mockall::mock; use s3::GetFile; use s3::SendFile; + use serde_json::json; #[tokio::test] async fn response_is_good() { mock! { FakeS3Client {} - #[async_trait] impl GetFile for FakeS3Client { - pub fn get_file(&self, url: String) -> Result, Box>; + fn get_file(&self, url: String) -> Result, Box>; } #[async_trait] impl SendFile for FakeS3Client { - pub async fn send_file(&self, route: String, token: String, vec: Vec) -> Result>; + async fn send_file(&self, route: String, token: String, vec: Vec) -> Result>; } } diff --git a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs index daba3739..5248bbc0 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs @@ -1,6 +1,8 @@ use async_trait::async_trait; -use aws_sdk_s3::{operation::write_get_object_response::WriteGetObjectResponseError, Client as S3Client}; -use aws_smithy_http::{byte_stream::ByteStream, result::SdkError}; +use aws_sdk_s3::{ + error::SdkError, operation::write_get_object_response::WriteGetObjectResponseError, primitives::ByteStream, + Client as S3Client, +}; use lambda_runtime::tracing; use std::{error, io::Read}; @@ -46,9 +48,8 @@ impl SendFile for S3Client { .send() .await; - if write.is_err() { - let sdk_error = write.err().unwrap(); - check_error(sdk_error); + if let Err(err) = write { + check_error(err); Err("WriteGetObjectResponse creation error".into()) } else { Ok("File sent.".to_string()) @@ -65,16 +66,16 @@ fn check_error(error: SdkError) { tracing::info!("DispatchFailure"); if err.is_io() { tracing::info!("IO error"); - }; + } if err.is_timeout() { tracing::info!("Timeout error"); - }; + } if err.is_user() { tracing::info!("User error"); }; - if err.is_other().is_some() { + if err.is_other() { tracing::info!("Other error"); - }; + } } SdkError::ResponseError(_err) => tracing::info!("ResponseError"), SdkError::TimeoutError(_err) => tracing::info!("TimeoutError"), diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index 4b9ef3da..d2303fec 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -19,15 +19,15 @@ aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } serde = "1" tokio = { version = "1", features = ["macros"] } -aws-config = "0.55" -aws-smithy-http = "0.55.3" -aws-sdk-s3 = "0.28" +aws-config = "1.5.14" +aws-smithy-http = "0.60.12" +aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" -mime = "0.3.16" -async-trait = "0.1.68" -webp = "=0.2.1" +mime = "0.3.17" +async-trait = "0.1.85" +webp = "=0.3.0" [dev-dependencies] -mockall = "0.11" +mockall = "0.13.1" tokio-test = "0.4" chrono = "0.4" diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 3eb5bfe9..279a2b09 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -111,7 +111,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -163,11 +163,11 @@ mod tests { #[async_trait] impl GetFile for FakeS3Client { - pub async fn get_file(&self, bucket: &str, key: &str) -> Result, GetObjectError>; + async fn get_file(&self, bucket: &str, key: &str) -> Result, GetObjectError>; } #[async_trait] impl PutFile for FakeS3Client { - pub async fn put_file(&self, bucket: &str, key: &str, bytes: Vec) -> Result; + async fn put_file(&self, bucket: &str, key: &str, bytes: Vec) -> Result; } } diff --git a/examples/basic-s3-thumbnail/src/s3.rs b/examples/basic-s3-thumbnail/src/s3.rs index 0dd8629d..a882a6ca 100644 --- a/examples/basic-s3-thumbnail/src/s3.rs +++ b/examples/basic-s3-thumbnail/src/s3.rs @@ -1,7 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::operation::get_object::GetObjectError; -use aws_sdk_s3::Client as S3Client; -use aws_smithy_http::byte_stream::ByteStream; +use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; use lambda_runtime::tracing; #[async_trait] diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index 454a970f..e9a0ee30 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] async-trait = "0.1" -aws-config = "0.54" -aws-sdk-s3 = "0.24" +aws-config = "1.5.14" +aws-sdk-s3 = "1.69.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } [dev-dependencies] -mockall = "0.11.3" -tokio-test = "0.4.2" \ No newline at end of file +mockall = "0.13.1" +tokio-test = "0.4.4" diff --git a/examples/basic-sdk/src/main.rs b/examples/basic-sdk/src/main.rs index d49c84e1..e416728a 100644 --- a/examples/basic-sdk/src/main.rs +++ b/examples/basic-sdk/src/main.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::{output::ListObjectsV2Output, Client as S3Client}; +use aws_sdk_s3::{operation::list_objects_v2::ListObjectsV2Output, Client as S3Client}; use lambda_runtime::{service_fn, tracing, Error, LambdaEvent}; use serde::{Deserialize, Serialize}; @@ -36,7 +36,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -52,7 +52,6 @@ async fn my_handler(event: LambdaEvent, client: &T) -> let objects_rsp = client.list_objects(&bucket).await?; let objects: Vec<_> = objects_rsp .contents() - .ok_or("missing objects in list-objects-v2 response")? .into_iter() .filter_map(|o| o.key().map(|k| k.to_string())) .collect(); @@ -71,7 +70,7 @@ async fn my_handler(event: LambdaEvent, client: &T) -> #[cfg(test)] mod tests { use super::*; - use aws_sdk_s3::model::Object; + use aws_sdk_s3::types::Object; use lambda_runtime::{Context, LambdaEvent}; use mockall::predicate::eq; diff --git a/examples/basic-shared-resource/Cargo.toml b/examples/basic-shared-resource/Cargo.toml index 2aad5886..66285643 100644 --- a/examples/basic-shared-resource/Cargo.toml +++ b/examples/basic-shared-resource/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-sqs/Cargo.toml b/examples/basic-sqs/Cargo.toml index 0df7d8e2..26235957 100644 --- a/examples/basic-sqs/Cargo.toml +++ b/examples/basic-sqs/Cargo.toml @@ -17,5 +17,5 @@ edition = "2021" [dependencies] aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-basic/Cargo.toml b/examples/extension-basic/Cargo.toml index 48e2ed51..6064b629 100644 --- a/examples/extension-basic/Cargo.toml +++ b/examples/extension-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-combined/Cargo.toml b/examples/extension-combined/Cargo.toml index 2a745c7b..88fcf4e2 100644 --- a/examples/extension-combined/Cargo.toml +++ b/examples/extension-combined/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-events/Cargo.toml b/examples/extension-custom-events/Cargo.toml index c2f813c3..0d9e0b9f 100644 --- a/examples/extension-custom-events/Cargo.toml +++ b/examples/extension-custom-events/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-service/Cargo.toml b/examples/extension-custom-service/Cargo.toml index b51eae8e..a6f2ece0 100644 --- a/examples/extension-custom-service/Cargo.toml +++ b/examples/extension-custom-service/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-internal-flush/Cargo.toml b/examples/extension-internal-flush/Cargo.toml index daadd0eb..6b2cc2b6 100644 --- a/examples/extension-internal-flush/Cargo.toml +++ b/examples/extension-internal-flush/Cargo.toml @@ -8,5 +8,5 @@ anyhow = "1" aws_lambda_events = { path = "../../lambda-events" } lambda-extension = { path = "../../lambda-extension" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "sync"] } diff --git a/examples/extension-logs-basic/Cargo.toml b/examples/extension-logs-basic/Cargo.toml index dccc1ec0..a4723bf2 100644 --- a/examples/extension-logs-basic/Cargo.toml +++ b/examples/extension-logs-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/extension-logs-custom-service/Cargo.toml b/examples/extension-logs-custom-service/Cargo.toml index 1b1eea0a..718a9cb3 100644 --- a/examples/extension-logs-custom-service/Cargo.toml +++ b/examples/extension-logs-custom-service/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-logs-kinesis-firehose/Cargo.toml b/examples/extension-logs-kinesis-firehose/Cargo.toml index c6675e5a..1d37049b 100644 --- a/examples/extension-logs-kinesis-firehose/Cargo.toml +++ b/examples/extension-logs-kinesis-firehose/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -tokio = { version = "1.17.0", features = ["full"] } -aws-config = "0.13.0" -aws-sdk-firehose = "0.13.0" +tokio = { version = "1.43.0", features = ["full"] } +aws-config = "1.5.14" +aws-sdk-firehose = "1.60.0" diff --git a/examples/extension-logs-kinesis-firehose/src/main.rs b/examples/extension-logs-kinesis-firehose/src/main.rs index 7871ce52..e46c335a 100644 --- a/examples/extension-logs-kinesis-firehose/src/main.rs +++ b/examples/extension-logs-kinesis-firehose/src/main.rs @@ -1,4 +1,4 @@ -use aws_sdk_firehose::{model::Record, types::Blob, Client}; +use aws_sdk_firehose::{primitives::Blob, types::Record, Client}; use lambda_extension::{tracing, Error, Extension, LambdaLog, LambdaLogRecord, Service, SharedService}; use std::{future::Future, pin::Pin, task::Poll}; @@ -31,7 +31,12 @@ impl Service> for FirehoseLogsProcessor { for log in logs { match log.record { LambdaLogRecord::Function(record) => { - records.push(Record::builder().data(Blob::new(record.as_bytes())).build()) + match Record::builder().data(Blob::new(record.as_bytes())).build() { + Ok(rec) => records.push(rec), + Err(e) => { + return Box::pin(async move { Err(e.into()) }); + } + } } _ => unreachable!(), } @@ -56,7 +61,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let config = aws_config::load_from_env().await; + let config = aws_config::from_env().load().await; let logs_processor = SharedService::new(FirehoseLogsProcessor::new(Client::new(&config))); Extension::new() diff --git a/examples/extension-telemetry-basic/Cargo.toml b/examples/extension-telemetry-basic/Cargo.toml index 1b8b1ba4..ecf6991d 100644 --- a/examples/extension-telemetry-basic/Cargo.toml +++ b/examples/extension-telemetry-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index c757aa94..6d4a399c 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" axum = "0.7" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.196" +serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 69366957..7eaf1232 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -5,15 +5,14 @@ edition = "2021" [dependencies] axum = "0.7" -bb8 = "0.8.0" -diesel = "2.0.3" -diesel-async = { version = "0.2.1", features = ["postgres", "bb8"] } +diesel = "2.2.6" +diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.159" -futures-util = "0.3.21" -rustls = "0.20.8" -rustls-native-certs = "0.6.2" -tokio = { version = "1.2.0", default-features = false, features = ["macros", "rt-multi-thread"] } -tokio-postgres = "0.7.7" -tokio-postgres-rustls = "0.9.0" \ No newline at end of file +serde = "1.0.217" +futures-util = "0.3.31" +rustls = "0.23.21" +rustls-native-certs = "0.8.1" +tokio = { version = "1.43.0", default-features = false, features = ["macros", "rt-multi-thread"] } +tokio-postgres = "0.7.12" +tokio-postgres-rustls = "0.13.0" diff --git a/examples/http-axum-diesel-ssl/src/main.rs b/examples/http-axum-diesel-ssl/src/main.rs index b340b44d..b71665a3 100755 --- a/examples/http-axum-diesel-ssl/src/main.rs +++ b/examples/http-axum-diesel-ssl/src/main.rs @@ -1,19 +1,20 @@ -use diesel::{ConnectionError, ConnectionResult}; -use futures_util::future::BoxFuture; -use futures_util::FutureExt; -use std::time::Duration; - use axum::{ extract::{Path, State}, response::Json, routing::get, Router, }; -use bb8::Pool; use diesel::prelude::*; -use diesel_async::{pooled_connection::AsyncDieselConnectionManager, AsyncPgConnection, RunQueryDsl}; +use diesel::{ConnectionError, ConnectionResult}; +use diesel_async::{ + pooled_connection::{bb8::Pool, AsyncDieselConnectionManager, ManagerConfig}, + AsyncPgConnection, RunQueryDsl, +}; +use futures_util::future::BoxFuture; +use futures_util::FutureExt; use lambda_http::{http::StatusCode, run, tracing, Error}; use serde::{Deserialize, Serialize}; +use std::time::Duration; table! { posts (id) { @@ -40,7 +41,7 @@ struct NewPost { published: bool, } -type AsyncPool = Pool>; +type AsyncPool = Pool; type ServerError = (StatusCode, String); async fn create_post(State(pool): State, Json(post): Json) -> Result, ServerError> { @@ -104,7 +105,10 @@ async fn main() -> Result<(), Error> { // Format for DATABASE_URL=postgres://your_username:your_password@your_host:5432/your_db?sslmode=require let db_url = std::env::var("DATABASE_URL").expect("Env var `DATABASE_URL` not set"); - let mgr = AsyncDieselConnectionManager::::new_with_setup(db_url, establish_connection); + let mut config = ManagerConfig::default(); + config.custom_setup = Box::new(establish_connection); + + let mgr = AsyncDieselConnectionManager::::new_with_config(db_url, config); let pool = Pool::builder() .max_size(10) @@ -129,19 +133,15 @@ fn establish_connection(config: &str) -> BoxFuture BoxFuture rustls::RootCertStore { let mut roots = rustls::RootCertStore::empty(); let certs = rustls_native_certs::load_native_certs().expect("Certs not loadable!"); - let certs: Vec<_> = certs.into_iter().map(|cert| cert.0).collect(); - roots.add_parsable_certificates(&certs); + roots.add_parsable_certificates(certs); roots } diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index 39fc813e..eefe6afd 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -5,10 +5,9 @@ edition = "2021" [dependencies] axum = "0.7" -bb8 = "0.8.0" -diesel = "2.0.3" -diesel-async = { version = "0.2.1", features = ["postgres", "bb8"] } +diesel = "2.2.6" +diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.159" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel/src/main.rs b/examples/http-axum-diesel/src/main.rs index b7247be4..348d7535 100644 --- a/examples/http-axum-diesel/src/main.rs +++ b/examples/http-axum-diesel/src/main.rs @@ -4,9 +4,11 @@ use axum::{ routing::get, Router, }; -use bb8::Pool; use diesel::prelude::*; -use diesel_async::{pooled_connection::AsyncDieselConnectionManager, AsyncPgConnection, RunQueryDsl}; +use diesel_async::{ + pooled_connection::{bb8::Pool, AsyncDieselConnectionManager}, + AsyncPgConnection, RunQueryDsl, +}; use lambda_http::{http::StatusCode, run, tracing, Error}; use serde::{Deserialize, Serialize}; @@ -35,7 +37,7 @@ struct NewPost { published: bool, } -type AsyncPool = Pool>; +type AsyncPool = Pool; type ServerError = (StatusCode, String); async fn create_post(State(pool): State, Json(post): Json) -> Result, ServerError> { diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 7ab3c0ec..0733d46a 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" axum = "0.7" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.196" +serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-cors/Cargo.toml b/examples/http-cors/Cargo.toml index b8e51031..e7eeefc6 100644 --- a/examples/http-cors/Cargo.toml +++ b/examples/http-cors/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -tower-http = { version = "0.5", features = ["cors"] } +tower-http = { version = "0.6", features = ["cors"] } diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index f2b8db98..62bd9225 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -simple-error = "0.3.0" -serde_json = "1.0.107" -serde = { version = "1.0.189", features = ["derive"] } -serde_dynamo = {version = "^4.2.7", features = ["aws-sdk-dynamodb+0_33"]} +simple-error = "0.3.1" +serde_json = "1.0.137" +serde = { version = "1.0.217", features = ["derive"] } +serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } lambda_http = { path = "../../lambda-http" } -aws-sdk-dynamodb = "0.33.0" -aws-config = "0.56.1" -tokio = { version = "1.33.0", features = ["macros"] } +aws-sdk-dynamodb = "1.60.0" +aws-config = "1.5.14" +tokio = { version = "1.43.0", features = ["macros"] } diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index e5cbb2a3..eb3d450f 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -1,15 +1,15 @@ use aws_sdk_dynamodb::Client; use lambda_http::{run, service_fn, tracing, Body, Error, Request, Response}; use serde::{Deserialize, Serialize}; -use serde_dynamo::to_attribute_value; +use serde_dynamo::to_item; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Item { - pub p_type: String, + pub account_type: String, pub age: String, pub username: String, - pub first: String, - pub last: String, + pub first_name: String, + pub last_name: String, } /// This is the main body for the function. @@ -58,7 +58,7 @@ async fn main() -> Result<(), Error> { tracing::init_default_subscriber(); //Get config from environment. - let config = aws_config::load_from_env().await; + let config = aws_config::from_env().load().await; //Create the DynamoDB client. let client = Client::new(&config); @@ -71,20 +71,14 @@ async fn main() -> Result<(), Error> { // Add an item to a table. // snippet-start:[dynamodb.rust.add-item] pub async fn add_item(client: &Client, item: Item, table: &str) -> Result<(), Error> { - let user_av = to_attribute_value(item.username)?; - let type_av = to_attribute_value(item.p_type)?; - let age_av = to_attribute_value(item.age)?; - let first_av = to_attribute_value(item.first)?; - let last_av = to_attribute_value(item.last)?; + let item = to_item(item)?; - let request = client - .put_item() - .table_name(table) - .item("username", user_av) - .item("account_type", type_av) - .item("age", age_av) - .item("first_name", first_av) - .item("last_name", last_av); + let request = client.put_item().table_name(table).set_item(Some(item)); + // .item("username", user_av) + // .item("account_type", type_av) + // .item("age", age_av) + // .item("first_name", first_av) + // .item("last_name", last_av); tracing::info!("adding item to DynamoDB"); diff --git a/examples/http-tower-trace/Cargo.toml b/examples/http-tower-trace/Cargo.toml index 36389f0e..dc3b6802 100644 --- a/examples/http-tower-trace/Cargo.toml +++ b/examples/http-tower-trace/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = "0.5.1" +lambda_runtime = "0.13.0" tokio = { version = "1", features = ["macros"] } -tower-http = { version = "0.5", features = ["trace"] } +tower-http = { version = "0.6", features = ["trace"] } diff --git a/examples/lambda-rds-iam-auth/Cargo.toml b/examples/lambda-rds-iam-auth/Cargo.toml index a1e212ae..1b869fd7 100644 --- a/examples/lambda-rds-iam-auth/Cargo.toml +++ b/examples/lambda-rds-iam-auth/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde_json = "1.0.120" -aws-config = "1.0.1" -aws-credential-types = "1.0.1" -aws-sigv4 = "1.0.1" -url = "2.5.0" -tokio = { version = "1.25.0", features = ["full"] } -sqlx = { version = "0.7.4", features = ["tls-rustls", "postgres", "runtime-tokio"] } +serde_json = "1.0.137" +aws-config = "1.5.14" +aws-credential-types = "1.2.1" +aws-sigv4 = "1.2.7" +url = "2.5.4" +tokio = { version = "1.43.0", features = ["full"] } +sqlx = { version = "0.8.3", features = ["tls-rustls", "postgres", "runtime-tokio"] } diff --git a/examples/opentelemetry-tracing/Cargo.toml b/examples/opentelemetry-tracing/Cargo.toml index 98108d39..18e5926c 100644 --- a/examples/opentelemetry-tracing/Cargo.toml +++ b/examples/opentelemetry-tracing/Cargo.toml @@ -5,14 +5,14 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime", features = ["opentelemetry"] } -opentelemetry-semantic-conventions = "0.14" -opentelemetry = "0.22" -opentelemetry_sdk = { version = "0.22", features = ["rt-tokio"] } -opentelemetry-stdout = { version = "0.3", features = ["trace"] } +opentelemetry-semantic-conventions = "0.27" +opentelemetry = "0.27" +opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } +opentelemetry-stdout = { version = "0.27", features = ["trace"] } pin-project = "1" serde_json = "1.0" tokio = "1" tower = "0.5" tracing = "0.1" -tracing-opentelemetry = "0.23" +tracing-opentelemetry = "0.28" tracing-subscriber = "0.3" diff --git a/lambda-events/Cargo.toml b/lambda-events/Cargo.toml index b8d34055..3b5b7ba0 100644 --- a/lambda-events/Cargo.toml +++ b/lambda-events/Cargo.toml @@ -19,7 +19,7 @@ edition = "2021" base64 = { workspace = true } bytes = { workspace = true, features = ["serde"], optional = true } chrono = { workspace = true, optional = true } -flate2 = { version = "1.0.24", optional = true } +flate2 = { version = "1.0.35", optional = true } http = { workspace = true, optional = true } http-body = { workspace = true, optional = true } http-serde = { workspace = true, optional = true } @@ -30,7 +30,7 @@ query_map = { version = "^0.7", features = [ serde = { version = "^1", features = ["derive"] } serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" -serde_dynamo = { version = "^4.1", optional = true } +serde_dynamo = { version = "^4.2", optional = true } [features] default = [ diff --git a/lambda-extension/Cargo.toml b/lambda-extension/Cargo.toml index 16b6dace..dc1834cd 100644 --- a/lambda-extension/Cargo.toml +++ b/lambda-extension/Cargo.toml @@ -28,12 +28,12 @@ hyper-util = { workspace = true } lambda_runtime_api_client = { version = "0.11", path = "../lambda-runtime-api-client" } serde = { version = "1", features = ["derive"] } serde_json = "^1" -tokio = { version = "1.0", features = [ +tokio = { version = "1.43", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.2" +tokio-stream = "0.1.17" tower = { workspace = true, features = ["make", "util"] } tracing = { version = "0.1", features = ["log"] } diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 46198dca..81e9c047 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -40,13 +40,13 @@ http-body-util = { workspace = true } hyper = { workspace = true } lambda_runtime = { version = "0.13.0", path = "../lambda-runtime" } mime = "0.3" -percent-encoding = "2.2" +percent-encoding = "2.3" pin-project-lite = { workspace = true } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["raw_value"] } serde_urlencoded = "0.7" -tokio-stream = "0.1.2" -url = "2.2" +tokio-stream = "0.1.17" +url = "2.5" [dependencies.aws_lambda_events] path = "../lambda-events" @@ -55,9 +55,9 @@ default-features = false features = ["alb", "apigw"] [dev-dependencies] -axum-core = "0.4.3" -axum-extra = { version = "0.9.2", features = ["query"] } +axum-core = "0.4.5" +axum-extra = { version = "0.9.6", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } log = "^0.4" maplit = "1.0" -tokio = { version = "1.0", features = ["macros"] } +tokio = { version = "1.43", features = ["macros"] } diff --git a/lambda-integration-tests/Cargo.toml b/lambda-integration-tests/Cargo.toml index ee44a969..dc6813b5 100644 --- a/lambda-integration-tests/Cargo.toml +++ b/lambda-integration-tests/Cargo.toml @@ -13,12 +13,12 @@ readme = "../README.md" [dependencies] lambda_runtime = { path = "../lambda-runtime" } aws_lambda_events = { path = "../lambda-events" } -serde_json = "1.0.121" +serde_json = "1.0.137" tokio = { version = "1", features = ["full"] } -serde = { version = "1.0.204", features = ["derive"] } +serde = { version = "1.0.217", features = ["derive"] } [dev-dependencies] -reqwest = { version = "0.12.5", features = ["blocking"] } +reqwest = { version = "0.12.12", features = ["blocking"] } openssl = { version = "0.10", features = ["vendored"] } [[bin]] diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 57fc4bca..03c155a3 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -33,6 +33,6 @@ hyper-util = { workspace = true, features = [ ] } tower = { workspace = true, features = ["util"] } tower-service = { workspace = true } -tokio = { version = "1.0", features = ["io-util"] } +tokio = { version = "1.43", features = ["io-util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index b4a7ad3d..48549777 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -22,7 +22,7 @@ eyre = ["dep:eyre"] # enables From for Diagnostic for eyre error types, see R miette = ["dep:miette"] # enables From for Diagnostic for miette error types, see README.md for more info [dependencies] -anyhow = { version = "1.0.86", optional = true } +anyhow = { version = "1.0.95", optional = true } async-stream = "0.3" base64 = { workspace = true } bytes = { workspace = true } @@ -40,19 +40,19 @@ hyper-util = { workspace = true, features = [ "tokio", ] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client", default-features = false } -miette = { version = "7.2.0", optional = true } +miette = { version = "7.4.0", optional = true } opentelemetry-semantic-conventions = { version = "0.27", optional = true, features = ["semconv_experimental"] } pin-project = "1" serde = { version = "1", features = ["derive", "rc"] } serde_json = "^1" -serde_path_to_error = "0.1.11" -tokio = { version = "1.0", features = [ +serde_path_to_error = "0.1.16" +tokio = { version = "1.43", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.2" +tokio-stream = "0.1.17" tower = { workspace = true, features = ["util"] } tower-layer = { workspace = true } tracing = { version = "0.1", features = ["log"] } From 31d111601ce27ad79d9ed52916889232176adb40 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:11:14 +0100 Subject: [PATCH 03/21] remove unused deps --- .../consumer/Cargo.toml | 2 -- .../producer/Cargo.toml | 1 - .../Cargo.toml | 2 -- .../basic-lambda-external-runtime/Cargo.toml | 3 --- examples/basic-lambda/Cargo.toml | 3 --- .../basic-s3-object-lambda-thumbnail/Cargo.toml | 4 ---- examples/basic-s3-thumbnail/Cargo.toml | 4 ---- examples/basic-s3-thumbnail/src/s3.rs | 2 +- examples/basic-sdk/Cargo.toml | 1 - examples/extension-basic/Cargo.toml | 1 - examples/extension-combined/Cargo.toml | 1 - examples/extension-custom-events/Cargo.toml | 1 - examples/extension-custom-service/Cargo.toml | 1 - examples/extension-logs-basic/Cargo.toml | 1 - .../extension-logs-custom-service/Cargo.toml | 1 - examples/extension-telemetry-basic/Cargo.toml | 1 - examples/http-axum-apigw-authorizer/Cargo.toml | 2 -- examples/http-axum-diesel-ssl/Cargo.toml | 1 - examples/http-axum-diesel/Cargo.toml | 1 - examples/http-axum-middleware/Cargo.toml | 1 - examples/http-axum/Cargo.toml | 1 - examples/http-basic-lambda/Cargo.toml | 1 - examples/http-cors/Cargo.toml | 1 - examples/http-dynamodb/Cargo.toml | 1 - examples/http-query-parameters/Cargo.toml | 1 - examples/http-raw-path/Cargo.toml | 1 - examples/http-shared-resource/Cargo.toml | 1 - examples/http-tower-trace/Cargo.toml | 1 - examples/opentelemetry-tracing/Cargo.toml | 2 -- lambda-extension/Cargo.toml | 1 - lambda-http/Cargo.toml | 4 ---- lambda-integration-tests/Cargo.toml | 1 - lambda-runtime-api-client/Cargo.toml | 4 ++-- lambda-runtime/Cargo.toml | 17 ----------------- 34 files changed, 3 insertions(+), 68 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 5a03daa6..31129b94 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" [dependencies] #aws dependencies -aws-sdk-config = "1.57.0" -aws-sdk-sqs = "1.54.0" aws_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false } #lambda runtime diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 8c2061db..4797c807 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -9,7 +9,6 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies aws-config = "1.5.14" -aws-sdk-config = "1.57.0" aws-sdk-sqs = "1.54.0" #lambda runtime diff --git a/examples/advanced-sqs-partial-batch-failures/Cargo.toml b/examples/advanced-sqs-partial-batch-failures/Cargo.toml index 5f89f606..f02e4efb 100644 --- a/examples/advanced-sqs-partial-batch-failures/Cargo.toml +++ b/examples/advanced-sqs-partial-batch-failures/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" [dependencies] serde = "^1" -serde_derive = "^1" -serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-lambda-external-runtime/Cargo.toml b/examples/basic-lambda-external-runtime/Cargo.toml index 7a7af473..6b0137f8 100644 --- a/examples/basic-lambda-external-runtime/Cargo.toml +++ b/examples/basic-lambda-external-runtime/Cargo.toml @@ -9,6 +9,3 @@ futures-lite = "2.6.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = "1.43.0" - -[dev-dependencies] -tokio-test = "0.4.4" diff --git a/examples/basic-lambda/Cargo.toml b/examples/basic-lambda/Cargo.toml index 6e74e4ef..265c3033 100644 --- a/examples/basic-lambda/Cargo.toml +++ b/examples/basic-lambda/Cargo.toml @@ -7,6 +7,3 @@ edition = "2021" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = { version = "1", features = ["macros"] } - -[dev-dependencies] -tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index ad40a9e2..ef9fc75e 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -17,7 +17,6 @@ edition = "2021" [dependencies] aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1" tokio = { version = "1", features = ["macros"] } aws-config = "1.5.14" aws-sdk-s3 = "1.69.0" @@ -25,10 +24,7 @@ thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.85" ureq = "2.12.1" -aws-smithy-http = "0.60.12" -webp = "=0.3.0" [dev-dependencies] serde_json = "1.0.137" mockall = "0.13.1" -tokio-test = "0.4.4" diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index d2303fec..a3cb36dc 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -17,17 +17,13 @@ edition = "2021" [dependencies] aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1" tokio = { version = "1", features = ["macros"] } aws-config = "1.5.14" -aws-smithy-http = "0.60.12" aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.85" -webp = "=0.3.0" [dev-dependencies] mockall = "0.13.1" -tokio-test = "0.4" chrono = "0.4" diff --git a/examples/basic-s3-thumbnail/src/s3.rs b/examples/basic-s3-thumbnail/src/s3.rs index a882a6ca..b8f8efa0 100644 --- a/examples/basic-s3-thumbnail/src/s3.rs +++ b/examples/basic-s3-thumbnail/src/s3.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; +use aws_sdk_s3::{operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; use lambda_runtime::tracing; #[async_trait] diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index e9a0ee30..c99739f9 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -15,4 +15,3 @@ tokio = { version = "1", features = ["macros"] } [dev-dependencies] mockall = "0.13.1" -tokio-test = "0.4.4" diff --git a/examples/extension-basic/Cargo.toml b/examples/extension-basic/Cargo.toml index 6064b629..d7cf1f13 100644 --- a/examples/extension-basic/Cargo.toml +++ b/examples/extension-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-combined/Cargo.toml b/examples/extension-combined/Cargo.toml index 88fcf4e2..93aacca1 100644 --- a/examples/extension-combined/Cargo.toml +++ b/examples/extension-combined/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-events/Cargo.toml b/examples/extension-custom-events/Cargo.toml index 0d9e0b9f..dfef4c4b 100644 --- a/examples/extension-custom-events/Cargo.toml +++ b/examples/extension-custom-events/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-service/Cargo.toml b/examples/extension-custom-service/Cargo.toml index a6f2ece0..8d0e4575 100644 --- a/examples/extension-custom-service/Cargo.toml +++ b/examples/extension-custom-service/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-logs-basic/Cargo.toml b/examples/extension-logs-basic/Cargo.toml index a4723bf2..230ebc7e 100644 --- a/examples/extension-logs-basic/Cargo.toml +++ b/examples/extension-logs-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/extension-logs-custom-service/Cargo.toml b/examples/extension-logs-custom-service/Cargo.toml index 718a9cb3..421fe9ff 100644 --- a/examples/extension-logs-custom-service/Cargo.toml +++ b/examples/extension-logs-custom-service/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-telemetry-basic/Cargo.toml b/examples/extension-telemetry-basic/Cargo.toml index ecf6991d..a0fb6b87 100644 --- a/examples/extension-telemetry-basic/Cargo.toml +++ b/examples/extension-telemetry-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index 6d4a399c..3deb07c8 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -6,7 +6,5 @@ edition = "2021" [dependencies] axum = "0.7" lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 7eaf1232..8d05dd4f 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -8,7 +8,6 @@ axum = "0.7" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" futures-util = "0.3.31" rustls = "0.23.21" diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index eefe6afd..05b482aa 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -8,6 +8,5 @@ axum = "0.7" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-middleware/Cargo.toml b/examples/http-axum-middleware/Cargo.toml index 228fc0ae..4f2ddfee 100644 --- a/examples/http-axum-middleware/Cargo.toml +++ b/examples/http-axum-middleware/Cargo.toml @@ -8,6 +8,5 @@ axum = "0.7" lambda_http = { path = "../../lambda-http", default-features = false, features = [ "apigw_rest", "tracing" ] } -lambda_runtime = { path = "../../lambda-runtime" } serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 0733d46a..8984841b 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] axum = "0.7" lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-basic-lambda/Cargo.toml b/examples/http-basic-lambda/Cargo.toml index c7a51507..2f252389 100644 --- a/examples/http-basic-lambda/Cargo.toml +++ b/examples/http-basic-lambda/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-cors/Cargo.toml b/examples/http-cors/Cargo.toml index e7eeefc6..b9c9efa5 100644 --- a/examples/http-cors/Cargo.toml +++ b/examples/http-cors/Cargo.toml @@ -5,6 +5,5 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } tower-http = { version = "0.6", features = ["cors"] } diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index 62bd9225..015e9f84 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -simple-error = "0.3.1" serde_json = "1.0.137" serde = { version = "1.0.217", features = ["derive"] } serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } diff --git a/examples/http-query-parameters/Cargo.toml b/examples/http-query-parameters/Cargo.toml index 2cadda95..18f8e6cf 100644 --- a/examples/http-query-parameters/Cargo.toml +++ b/examples/http-query-parameters/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-raw-path/Cargo.toml b/examples/http-raw-path/Cargo.toml index f6c56526..d1c5ccb8 100644 --- a/examples/http-raw-path/Cargo.toml +++ b/examples/http-raw-path/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-shared-resource/Cargo.toml b/examples/http-shared-resource/Cargo.toml index 923ceecc..8f5a0e94 100644 --- a/examples/http-shared-resource/Cargo.toml +++ b/examples/http-shared-resource/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-tower-trace/Cargo.toml b/examples/http-tower-trace/Cargo.toml index dc3b6802..cf1f223b 100644 --- a/examples/http-tower-trace/Cargo.toml +++ b/examples/http-tower-trace/Cargo.toml @@ -5,6 +5,5 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = "0.13.0" tokio = { version = "1", features = ["macros"] } tower-http = { version = "0.6", features = ["trace"] } diff --git a/examples/opentelemetry-tracing/Cargo.toml b/examples/opentelemetry-tracing/Cargo.toml index 18e5926c..9aea3907 100644 --- a/examples/opentelemetry-tracing/Cargo.toml +++ b/examples/opentelemetry-tracing/Cargo.toml @@ -5,11 +5,9 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime", features = ["opentelemetry"] } -opentelemetry-semantic-conventions = "0.27" opentelemetry = "0.27" opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } opentelemetry-stdout = { version = "0.27", features = ["trace"] } -pin-project = "1" serde_json = "1.0" tokio = "1" tower = "0.5" diff --git a/lambda-extension/Cargo.toml b/lambda-extension/Cargo.toml index dc1834cd..09343da2 100644 --- a/lambda-extension/Cargo.toml +++ b/lambda-extension/Cargo.toml @@ -19,7 +19,6 @@ tracing = ["lambda_runtime_api_client/tracing"] [dependencies] async-stream = "0.3" -bytes = { workspace = true } chrono = { workspace = true, features = ["serde"] } http = { workspace = true } http-body-util = { workspace = true } diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 81e9c047..180de65c 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -29,15 +29,12 @@ eyre = ["lambda_runtime/eyre"] # enables From for Diagnostic for eyre error t miette = ["lambda_runtime/miette"] # enables From for Diagnostic for miette error types, see README.md for more info [dependencies] -base64 = { workspace = true } bytes = { workspace = true } encoding_rs = "0.8" -futures = { workspace = true } futures-util = { workspace = true } http = { workspace = true } http-body = { workspace = true } http-body-util = { workspace = true } -hyper = { workspace = true } lambda_runtime = { version = "0.13.0", path = "../lambda-runtime" } mime = "0.3" percent-encoding = "2.3" @@ -58,6 +55,5 @@ features = ["alb", "apigw"] axum-core = "0.4.5" axum-extra = { version = "0.9.6", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } -log = "^0.4" maplit = "1.0" tokio = { version = "1.43", features = ["macros"] } diff --git a/lambda-integration-tests/Cargo.toml b/lambda-integration-tests/Cargo.toml index dc6813b5..bafb6a45 100644 --- a/lambda-integration-tests/Cargo.toml +++ b/lambda-integration-tests/Cargo.toml @@ -19,7 +19,6 @@ serde = { version = "1.0.217", features = ["derive"] } [dev-dependencies] reqwest = { version = "0.12.12", features = ["blocking"] } -openssl = { version = "0.10", features = ["vendored"] } [[bin]] name = "helloworld" diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 03c155a3..8db83b84 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -32,7 +32,7 @@ hyper-util = { workspace = true, features = [ "tokio", ] } tower = { workspace = true, features = ["util"] } -tower-service = { workspace = true } -tokio = { version = "1.43", features = ["io-util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } + +[dev-dependencies] diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index 48549777..c64ad69a 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -29,16 +29,9 @@ bytes = { workspace = true } eyre = { version = "0.6.12", optional = true } futures = { workspace = true } http = { workspace = true } -http-body = { workspace = true } http-body-util = { workspace = true } http-serde = { workspace = true } hyper = { workspace = true, features = ["http1", "client"] } -hyper-util = { workspace = true, features = [ - "client", - "client-legacy", - "http1", - "tokio", -] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client", default-features = false } miette = { version = "7.4.0", optional = true } opentelemetry-semantic-conventions = { version = "0.27", optional = true, features = ["semconv_experimental"] } @@ -54,17 +47,7 @@ tokio = { version = "1.43", features = [ ] } tokio-stream = "0.1.17" tower = { workspace = true, features = ["util"] } -tower-layer = { workspace = true } tracing = { version = "0.1", features = ["log"] } [dev-dependencies] httpmock = "0.7.0" -hyper-util = { workspace = true, features = [ - "client", - "client-legacy", - "http1", - "server", - "server-auto", - "tokio", -] } -pin-project-lite = { workspace = true } From 3f53ec4c4c41f81c5ff250e9fb824578f058d408 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:31:30 +0100 Subject: [PATCH 04/21] add feature flag for aws-config --- .../producer/Cargo.toml | 2 +- examples/basic-cognito-post-confirmation/Cargo.toml | 2 +- examples/basic-s3-object-lambda-thumbnail/Cargo.toml | 2 +- examples/basic-s3-thumbnail/Cargo.toml | 2 +- examples/basic-sdk/Cargo.toml | 2 +- examples/extension-logs-kinesis-firehose/Cargo.toml | 2 +- examples/http-dynamodb/Cargo.toml | 2 +- examples/lambda-rds-iam-auth/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 4797c807..0a9fe450 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -8,7 +8,7 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-sqs = "1.54.0" #lambda runtime diff --git a/examples/basic-cognito-post-confirmation/Cargo.toml b/examples/basic-cognito-post-confirmation/Cargo.toml index de6b8085..afd44a4f 100644 --- a/examples/basic-cognito-post-confirmation/Cargo.toml +++ b/examples/basic-cognito-post-confirmation/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-ses = "1.57.0" aws_lambda_events = { path = "../../lambda-events", default-features = false, features = ["cognito"] } diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index ef9fc75e..accd209c 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index a3cb36dc..147a914e 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index c99739f9..fb8513a8 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] async-trait = "0.1" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" diff --git a/examples/extension-logs-kinesis-firehose/Cargo.toml b/examples/extension-logs-kinesis-firehose/Cargo.toml index 1d37049b..3cdeb6dd 100644 --- a/examples/extension-logs-kinesis-firehose/Cargo.toml +++ b/examples/extension-logs-kinesis-firehose/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } tokio = { version = "1.43.0", features = ["full"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-firehose = "1.60.0" diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index 015e9f84..d10c098c 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -9,5 +9,5 @@ serde = { version = "1.0.217", features = ["derive"] } serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } lambda_http = { path = "../../lambda-http" } aws-sdk-dynamodb = "1.60.0" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } tokio = { version = "1.43.0", features = ["macros"] } diff --git a/examples/lambda-rds-iam-auth/Cargo.toml b/examples/lambda-rds-iam-auth/Cargo.toml index 1b869fd7..6b56e254 100644 --- a/examples/lambda-rds-iam-auth/Cargo.toml +++ b/examples/lambda-rds-iam-auth/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } serde_json = "1.0.137" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-credential-types = "1.2.1" aws-sigv4 = "1.2.7" url = "2.5.4" From f7244fd834f9ce9992ce044da6d3ba7d29e6adf7 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:38:37 +0100 Subject: [PATCH 05/21] update axum --- examples/http-axum-apigw-authorizer/Cargo.toml | 2 +- examples/http-axum-apigw-authorizer/src/main.rs | 3 --- examples/http-axum-diesel-ssl/Cargo.toml | 2 +- examples/http-axum-diesel/Cargo.toml | 2 +- examples/http-axum-middleware/Cargo.toml | 2 +- examples/http-axum/Cargo.toml | 2 +- lambda-http/Cargo.toml | 4 ++-- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index 3deb07c8..44c50167 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http" } serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-apigw-authorizer/src/main.rs b/examples/http-axum-apigw-authorizer/src/main.rs index 513a6cd8..8adb9024 100644 --- a/examples/http-axum-apigw-authorizer/src/main.rs +++ b/examples/http-axum-apigw-authorizer/src/main.rs @@ -1,5 +1,4 @@ use axum::{ - async_trait, extract::{FromRequest, Request}, http::StatusCode, response::Json, @@ -13,7 +12,6 @@ use std::{collections::HashMap, env::set_var}; struct AuthorizerField(String); struct AuthorizerFields(HashMap); -#[async_trait] impl FromRequest for AuthorizerField where S: Send + Sync, @@ -30,7 +28,6 @@ where } } -#[async_trait] impl FromRequest for AuthorizerFields where S: Send + Sync, diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 8d05dd4f..98827228 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index 05b482aa..5ac39dce 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } diff --git a/examples/http-axum-middleware/Cargo.toml b/examples/http-axum-middleware/Cargo.toml index 4f2ddfee..f3966941 100644 --- a/examples/http-axum-middleware/Cargo.toml +++ b/examples/http-axum-middleware/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http", default-features = false, features = [ "apigw_rest", "tracing" ] } diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 8984841b..a3052a5c 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http" } serde = "1.0.217" serde_json = "1.0" diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 180de65c..cc8c2fd6 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -52,8 +52,8 @@ default-features = false features = ["alb", "apigw"] [dev-dependencies] -axum-core = "0.4.5" -axum-extra = { version = "0.9.6", features = ["query"] } +axum-core = "0.5.0" +axum-extra = { version = "0.10.0", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } maplit = "1.0" tokio = { version = "1.43", features = ["macros"] } From 5d8d7e39e3c66e4d7a554159e6828e06a4690e18 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:43:37 +0100 Subject: [PATCH 06/21] revert derive --- lambda-runtime/src/layers/otel.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda-runtime/src/layers/otel.rs b/lambda-runtime/src/layers/otel.rs index 5598d745..f50f36f7 100644 --- a/lambda-runtime/src/layers/otel.rs +++ b/lambda-runtime/src/layers/otel.rs @@ -8,7 +8,6 @@ use tracing::{field, instrument::Instrumented, Instrument}; /// Tower layer to add OpenTelemetry tracing to a Lambda function invocation. The layer accepts /// a function to flush OpenTelemetry after the end of the invocation. -#[derive(Copy, Clone)] pub struct OpenTelemetryLayer { flush_fn: F, otel_attribute_trigger: OpenTelemetryFaasTrigger, From 7bccca5d013999944d5f9b80c4364a5a78fd990b Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:44:51 +0100 Subject: [PATCH 07/21] update --- lambda-runtime-api-client/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 8db83b84..341c20bd 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -34,5 +34,3 @@ hyper-util = { workspace = true, features = [ tower = { workspace = true, features = ["util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } - -[dev-dependencies] From b784d45d3c224be3449d2916fb5b52875a3ef08b Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:00:16 +0100 Subject: [PATCH 08/21] remove ';' --- examples/basic-s3-object-lambda-thumbnail/src/s3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs index 5248bbc0..0b4967d3 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs @@ -72,7 +72,7 @@ fn check_error(error: SdkError) { } if err.is_user() { tracing::info!("User error"); - }; + } if err.is_other() { tracing::info!("Other error"); } From 267c79bba78814efc30c14611ffb50320640edb1 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:01:22 +0100 Subject: [PATCH 09/21] use aws_config::load_from_env().await; --- .../producer/src/main.rs | 2 +- examples/basic-s3-object-lambda-thumbnail/src/main.rs | 2 +- examples/basic-s3-thumbnail/src/main.rs | 2 +- examples/basic-sdk/src/main.rs | 2 +- examples/extension-logs-kinesis-firehose/src/main.rs | 2 +- examples/http-dynamodb/src/main.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs b/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs index 2a70dce3..6a2883f3 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs @@ -20,7 +20,7 @@ async fn main() -> Result<(), Error> { // read the queue url from the environment let queue_url = std::env::var("QUEUE_URL").expect("could not read QUEUE_URL"); // build the config from environment variables (fed by AWS Lambda) - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; // create our SQS Manager let sqs_manager = SQSManager::new(aws_sdk_sqs::Client::new(&config), queue_url); let sqs_manager_ref = &sqs_manager; diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index 90cfeec9..b34122a1 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 279a2b09..8cfbce62 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -111,7 +111,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/basic-sdk/src/main.rs b/examples/basic-sdk/src/main.rs index e416728a..6bdd4045 100644 --- a/examples/basic-sdk/src/main.rs +++ b/examples/basic-sdk/src/main.rs @@ -36,7 +36,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/extension-logs-kinesis-firehose/src/main.rs b/examples/extension-logs-kinesis-firehose/src/main.rs index e46c335a..c9d8a2e4 100644 --- a/examples/extension-logs-kinesis-firehose/src/main.rs +++ b/examples/extension-logs-kinesis-firehose/src/main.rs @@ -61,7 +61,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; let logs_processor = SharedService::new(FirehoseLogsProcessor::new(Client::new(&config))); Extension::new() diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index eb3d450f..d290d807 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -58,7 +58,7 @@ async fn main() -> Result<(), Error> { tracing::init_default_subscriber(); //Get config from environment. - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; //Create the DynamoDB client. let client = Client::new(&config); From f5ae66631f3bdc1baa29c38a9318326312e52c28 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:04:57 +0100 Subject: [PATCH 10/21] remove comments --- examples/http-dynamodb/src/main.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index d290d807..3964ad3a 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -74,11 +74,6 @@ pub async fn add_item(client: &Client, item: Item, table: &str) -> Result<(), Er let item = to_item(item)?; let request = client.put_item().table_name(table).set_item(Some(item)); - // .item("username", user_av) - // .item("account_type", type_av) - // .item("age", age_av) - // .item("first_name", first_av) - // .item("last_name", last_av); tracing::info!("adding item to DynamoDB"); From 634b9eed229995e25f596c62e5e2ad8898e33c41 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 05:44:32 +0200 Subject: [PATCH 11/21] revert --- Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 373eae1c..867e9c0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["examples"] [workspace.dependencies] base64 = "0.22" bytes = "1" -chrono = { version = "0.4.39", default-features = false, features = [ +chrono = { version = "0.4.35", default-features = false, features = [ "clock", "serde", "std", @@ -22,12 +22,12 @@ chrono = { version = "0.4.39", default-features = false, features = [ futures = "0.3" futures-channel = "0.3" futures-util = "0.3" -http = "1.2" +http = "1.0" http-body = "1.0" http-body-util = "0.1" -http-serde = "2.1" -hyper = "1.5" -hyper-util = "0.1.10" +http-serde = "2.0" +hyper = "1.0" +hyper-util = "0.1.1" pin-project-lite = "0.2" tower = "0.5" tower-layer = "0.3" From a72d56d2d0d1a6c2f13269dee2b8ed9325893182 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 05:51:02 +0200 Subject: [PATCH 12/21] rev --- lambda-events/Cargo.toml | 4 ++-- lambda-extension/Cargo.toml | 4 ++-- lambda-http/Cargo.toml | 10 ++++---- lambda-integration-tests/Cargo.toml | 6 ++--- .../tests/integration_test.rs | 24 +++++++++---------- lambda-runtime/Cargo.toml | 10 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lambda-events/Cargo.toml b/lambda-events/Cargo.toml index cd7be80e..481f77ba 100644 --- a/lambda-events/Cargo.toml +++ b/lambda-events/Cargo.toml @@ -20,7 +20,7 @@ edition = "2021" base64 = { workspace = true } bytes = { workspace = true, features = ["serde"], optional = true } chrono = { workspace = true, optional = true } -flate2 = { version = "1.0.35", optional = true } +flate2 = { version = "1.0.24", optional = true } http = { workspace = true, optional = true } http-body = { workspace = true, optional = true } http-serde = { workspace = true, optional = true } @@ -31,7 +31,7 @@ query_map = { version = "^0.7", features = [ serde = { version = "^1", features = ["derive"] } serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" -serde_dynamo = { version = "^4.2", optional = true } +serde_dynamo = { version = "^4.1", optional = true } [features] default = [ diff --git a/lambda-extension/Cargo.toml b/lambda-extension/Cargo.toml index 29a949eb..d178520a 100644 --- a/lambda-extension/Cargo.toml +++ b/lambda-extension/Cargo.toml @@ -28,13 +28,13 @@ hyper-util = { workspace = true } lambda_runtime_api_client = { version = "0.12", path = "../lambda-runtime-api-client" } serde = { version = "1", features = ["derive"] } serde_json = "^1" -tokio = { version = "1.43", features = [ +tokio = { version = "1.0", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.17" +tokio-stream = "0.1.2" tower = { workspace = true, features = ["make", "util"] } tracing = { version = "0.1", features = ["log"] } diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index cff13025..4498e275 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -39,13 +39,13 @@ http-body-util = { workspace = true } hyper = { workspace = true } lambda_runtime = { version = "0.14.2", path = "../lambda-runtime" } mime = "0.3" -percent-encoding = "2.3" +percent-encoding = "2.2" pin-project-lite = { workspace = true } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["raw_value"] } serde_urlencoded = "0.7" -tokio-stream = "0.1.17" -url = "2.5" +tokio-stream = "0.1.2" +url = "2.2" [dependencies.aws_lambda_events] path = "../lambda-events" @@ -57,9 +57,9 @@ features = ["alb", "apigw"] axum-core = "0.5.0" axum-extra = { version = "0.10.0", features = ["query"] } lambda_runtime_api_client = { version = "0.12.1", path = "../lambda-runtime-api-client" } -maplit = "1.0" -tokio = { version = "1.43", features = ["macros"] } log = "^0.4" +maplit = "1.0" +tokio = { version = "1.0", features = ["macros"] } [package.metadata.docs.rs] all-features = true diff --git a/lambda-integration-tests/Cargo.toml b/lambda-integration-tests/Cargo.toml index 94ec733f..0a9836c4 100644 --- a/lambda-integration-tests/Cargo.toml +++ b/lambda-integration-tests/Cargo.toml @@ -14,12 +14,12 @@ readme = "../README.md" [dependencies] lambda_runtime = { path = "../lambda-runtime", features = ["tracing", "graceful-shutdown"] } aws_lambda_events = { path = "../lambda-events" } -serde_json = "1.0.137" +serde_json = "1.0.121" tokio = { version = "1", features = ["full"] } -serde = { version = "1.0.217", features = ["derive"] } +serde = { version = "1.0.204", features = ["derive"] } [dev-dependencies] -reqwest = { version = "0.12.12", features = ["blocking"] } +reqwest = { version = "0.12.5", features = ["blocking"] } [[bin]] name = "helloworld" diff --git a/lambda-integration-tests/tests/integration_test.rs b/lambda-integration-tests/tests/integration_test.rs index 557b8e0d..08e3e4fd 100644 --- a/lambda-integration-tests/tests/integration_test.rs +++ b/lambda-integration-tests/tests/integration_test.rs @@ -1,12 +1,12 @@ -#[test] -fn test_calling_lambda_should_return_200() { - let test_endpoint = std::env::var("TEST_ENDPOINT").expect("could not read TEST_ENDPOINT"); - let secret_token = std::env::var("SECRET_TOKEN").expect("could not read SECRET_TOKEN"); - let client = reqwest::blocking::Client::new(); - let res = client - .get(test_endpoint) - .header("Authorization", secret_token) - .send() - .expect("could not the request"); - assert_eq!(res.status(), 200); -} +// #[test] +// fn test_calling_lambda_should_return_200() { +// let test_endpoint = std::env::var("TEST_ENDPOINT").expect("could not read TEST_ENDPOINT"); +// let secret_token = std::env::var("SECRET_TOKEN").expect("could not read SECRET_TOKEN"); +// let client = reqwest::blocking::Client::new(); +// let res = client +// .get(test_endpoint) +// .header("Authorization", secret_token) +// .send() +// .expect("could not the request"); +// assert_eq!(res.status(), 200); +// } diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index 5dd67ed6..aafffcb9 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -27,7 +27,7 @@ miette = ["dep:miette"] # enables From for Diagnostic for miette error types, graceful-shutdown = ["tokio/rt", "tokio/signal", "dep:lambda-extension"] [dependencies] -anyhow = { version = "1.0.95", optional = true } +anyhow = { version = "1.0.86", optional = true } async-stream = "0.3" base64 = { workspace = true } bytes = { workspace = true } @@ -40,19 +40,19 @@ hyper = { workspace = true, features = ["http1", "client"] } lambda-extension = { version = "0.12.1", path = "../lambda-extension", default-features = false, optional = true } lambda_runtime_api_client = { version = "0.12.2", path = "../lambda-runtime-api-client", default-features = false } -miette = { version = "7.4.0", optional = true } +miette = { version = "7.2.0", optional = true } opentelemetry-semantic-conventions = { version = "0.29", optional = true, features = ["semconv_experimental"] } pin-project = "1" serde = { version = "1", features = ["derive", "rc"] } serde_json = "^1" -serde_path_to_error = "0.1.16" +serde_path_to_error = "0.1.11" tokio = { version = "1.46", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.17" +tokio-stream = "0.1.2" tower = { workspace = true, features = ["util"] } tracing = { version = "0.1", features = ["log"] } @@ -75,4 +75,4 @@ pin-project-lite = { workspace = true } tracing-appender = "0.2" [package.metadata.docs.rs] -all-features = true +all-features = true \ No newline at end of file From 2261bae59e6734e3cc1c7fd52a09444f96da6dcb Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 05:58:06 +0200 Subject: [PATCH 13/21] rev --- .../tests/integration_test.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lambda-integration-tests/tests/integration_test.rs b/lambda-integration-tests/tests/integration_test.rs index 08e3e4fd..557b8e0d 100644 --- a/lambda-integration-tests/tests/integration_test.rs +++ b/lambda-integration-tests/tests/integration_test.rs @@ -1,12 +1,12 @@ -// #[test] -// fn test_calling_lambda_should_return_200() { -// let test_endpoint = std::env::var("TEST_ENDPOINT").expect("could not read TEST_ENDPOINT"); -// let secret_token = std::env::var("SECRET_TOKEN").expect("could not read SECRET_TOKEN"); -// let client = reqwest::blocking::Client::new(); -// let res = client -// .get(test_endpoint) -// .header("Authorization", secret_token) -// .send() -// .expect("could not the request"); -// assert_eq!(res.status(), 200); -// } +#[test] +fn test_calling_lambda_should_return_200() { + let test_endpoint = std::env::var("TEST_ENDPOINT").expect("could not read TEST_ENDPOINT"); + let secret_token = std::env::var("SECRET_TOKEN").expect("could not read SECRET_TOKEN"); + let client = reqwest::blocking::Client::new(); + let res = client + .get(test_endpoint) + .header("Authorization", secret_token) + .send() + .expect("could not the request"); + assert_eq!(res.status(), 200); +} From c66595212398b74c41e838a65d4259071e051671 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 06:18:44 +0200 Subject: [PATCH 14/21] bump ex --- examples/advanced-appconfig-feature-flags/Cargo.toml | 4 ++-- .../consumer/Cargo.toml | 2 +- .../pizza_lib/Cargo.toml | 2 +- .../producer/Cargo.toml | 6 +++--- examples/basic-cognito-post-confirmation/Cargo.toml | 4 ++-- .../basic-error-error-crates-integration/Cargo.toml | 2 +- examples/basic-error-handling/Cargo.toml | 4 ++-- examples/basic-lambda-external-runtime/Cargo.toml | 6 +++--- examples/basic-lambda/Cargo.toml | 2 +- examples/basic-s3-object-lambda-thumbnail/Cargo.toml | 12 ++++++------ examples/basic-s3-thumbnail/Cargo.toml | 6 +++--- examples/basic-sdk/Cargo.toml | 6 +++--- examples/basic-shared-resource/Cargo.toml | 2 +- examples/basic-sqs/Cargo.toml | 2 +- examples/extension-internal-flush/Cargo.toml | 2 +- examples/extension-logs-kinesis-firehose/Cargo.toml | 6 +++--- examples/http-axum-diesel-ssl/Cargo.toml | 12 ++++++------ examples/http-axum-diesel/Cargo.toml | 6 +++--- examples/http-axum/Cargo.toml | 2 +- examples/http-dynamodb/Cargo.toml | 10 +++++----- examples/lambda-rds-iam-auth/Cargo.toml | 12 ++++++------ 21 files changed, 55 insertions(+), 55 deletions(-) diff --git a/examples/advanced-appconfig-feature-flags/Cargo.toml b/examples/advanced-appconfig-feature-flags/Cargo.toml index e19bd3ea..cd11b162 100644 --- a/examples/advanced-appconfig-feature-flags/Cargo.toml +++ b/examples/advanced-appconfig-feature-flags/Cargo.toml @@ -15,8 +15,8 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -async-trait = "0.1.85" -lambda_runtime = "0.13" +async-trait = "0.1.88" +lambda_runtime = { path = "../../../lambda-runtime" } reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 31129b94..48fc3437 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] #aws dependencies -aws_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false } +aws_lambda_events = { version = "0.16.1", features = ["sqs"], default-features = false } #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml index 17486621..2dd69db1 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -serde = { version = "1.0.217", features = ["derive"] } +serde = { version = "1.0.219", features = ["derive"] } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 0a9fe450..2772f650 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -8,12 +8,12 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-sqs = "1.54.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-sqs = "1.74.0" #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } -serde_json = "1.0.137" +serde_json = "1.0.140" tokio = { version = "1", features = ["macros"] } #shared lib diff --git a/examples/basic-cognito-post-confirmation/Cargo.toml b/examples/basic-cognito-post-confirmation/Cargo.toml index afd44a4f..93369e51 100644 --- a/examples/basic-cognito-post-confirmation/Cargo.toml +++ b/examples/basic-cognito-post-confirmation/Cargo.toml @@ -15,8 +15,8 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-ses = "1.57.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-ses = "1.77.0" aws_lambda_events = { path = "../../lambda-events", default-features = false, features = ["cognito"] } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-error-error-crates-integration/Cargo.toml b/examples/basic-error-error-crates-integration/Cargo.toml index ccc62403..24fbc8dc 100644 --- a/examples/basic-error-error-crates-integration/Cargo.toml +++ b/examples/basic-error-error-crates-integration/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" anyhow = "1" eyre = "0.6.12" lambda_runtime = { path = "../../lambda-runtime", features = ["anyhow", "eyre", "miette"] } -miette = "7.4.0" +miette = "7.6.0" serde = "1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-error-handling/Cargo.toml b/examples/basic-error-handling/Cargo.toml index 55da8395..a0267f97 100644 --- a/examples/basic-error-handling/Cargo.toml +++ b/examples/basic-error-handling/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" -serde_json = "1.0.137" +serde = "1.0.219" +serde_json = "1.0.140" simple-error = "0.3.1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-lambda-external-runtime/Cargo.toml b/examples/basic-lambda-external-runtime/Cargo.toml index 6b0137f8..40f24d81 100644 --- a/examples/basic-lambda-external-runtime/Cargo.toml +++ b/examples/basic-lambda-external-runtime/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -async-channel = "2.3.1" +async-channel = "2.5.0" futures-lite = "2.6.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" -tokio = "1.43.0" +serde = "1.0.219" +tokio = "1.46.1" diff --git a/examples/basic-lambda/Cargo.toml b/examples/basic-lambda/Cargo.toml index 265c3033..afc727c4 100644 --- a/examples/basic-lambda/Cargo.toml +++ b/examples/basic-lambda/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index accd209c..86533b4b 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -15,16 +15,16 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws_lambda_events = "0.16.0" +aws_lambda_events = "0.16.1" lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-s3 = "1.69.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-s3 = "1.96.0" thumbnailer = "0.5.1" mime = "0.3.17" -async-trait = "0.1.85" -ureq = "2.12.1" +async-trait = "0.1.88" +ureq = "3.0.12" [dev-dependencies] -serde_json = "1.0.137" +serde_json = "1.0.140" mockall = "0.13.1" diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index 147a914e..fdbd79be 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -18,11 +18,11 @@ edition = "2021" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-s3 = "1.69.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-s3 = "1.96.0" thumbnailer = "0.5.1" mime = "0.3.17" -async-trait = "0.1.85" +async-trait = "0.1.88" [dev-dependencies] mockall = "0.13.1" diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index fb8513a8..6e680aaf 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" [dependencies] async-trait = "0.1" -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-s3 = "1.69.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-s3 = "1.96.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1", features = ["macros"] } [dev-dependencies] diff --git a/examples/basic-shared-resource/Cargo.toml b/examples/basic-shared-resource/Cargo.toml index 66285643..514bef32 100644 --- a/examples/basic-shared-resource/Cargo.toml +++ b/examples/basic-shared-resource/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-sqs/Cargo.toml b/examples/basic-sqs/Cargo.toml index 26235957..36efee36 100644 --- a/examples/basic-sqs/Cargo.toml +++ b/examples/basic-sqs/Cargo.toml @@ -17,5 +17,5 @@ edition = "2021" [dependencies] aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-internal-flush/Cargo.toml b/examples/extension-internal-flush/Cargo.toml index 5bca62e6..1a0747dd 100644 --- a/examples/extension-internal-flush/Cargo.toml +++ b/examples/extension-internal-flush/Cargo.toml @@ -8,5 +8,5 @@ anyhow = "1" aws_lambda_events = { path = "../../lambda-events" } lambda-extension = { path = "../../lambda-extension" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1.46", features = ["macros", "sync"] } diff --git a/examples/extension-logs-kinesis-firehose/Cargo.toml b/examples/extension-logs-kinesis-firehose/Cargo.toml index 3cdeb6dd..84f7ac96 100644 --- a/examples/extension-logs-kinesis-firehose/Cargo.toml +++ b/examples/extension-logs-kinesis-firehose/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -tokio = { version = "1.43.0", features = ["full"] } -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-sdk-firehose = "1.60.0" +tokio = { version = "1.46.1", features = ["full"] } +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-sdk-firehose = "1.82.0" diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 98827228..d21df0b9 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -5,13 +5,13 @@ edition = "2021" [dependencies] axum = "0.8" -diesel = "2.2.6" -diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } +diesel = "2.2.11" +diesel-async = { version = "0.6.1", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -serde = "1.0.217" +serde = "1.0.219" futures-util = "0.3.31" -rustls = "0.23.21" +rustls = "0.23.28" rustls-native-certs = "0.8.1" -tokio = { version = "1.43.0", default-features = false, features = ["macros", "rt-multi-thread"] } -tokio-postgres = "0.7.12" +tokio = { version = "1.46.1", default-features = false, features = ["macros", "rt-multi-thread"] } +tokio-postgres = "0.7.13" tokio-postgres-rustls = "0.13.0" diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index 5ac39dce..bed36762 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] axum = "0.8" -diesel = "2.2.6" -diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } +diesel = "2.2.11" +diesel-async = { version = "0.6.1", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -serde = "1.0.217" +serde = "1.0.219" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index a3052a5c..7664e7a7 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" [dependencies] axum = "0.8" lambda_http = { path = "../../lambda-http" } -serde = "1.0.217" +serde = "1.0.219" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index d10c098c..d347c346 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] -serde_json = "1.0.137" -serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.140" +serde = { version = "1.0.219", features = ["derive"] } serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } lambda_http = { path = "../../lambda-http" } -aws-sdk-dynamodb = "1.60.0" -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -tokio = { version = "1.43.0", features = ["macros"] } +aws-sdk-dynamodb = "1.82.0" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +tokio = { version = "1.46.1", features = ["macros"] } diff --git a/examples/lambda-rds-iam-auth/Cargo.toml b/examples/lambda-rds-iam-auth/Cargo.toml index 6b56e254..68b0fe92 100644 --- a/examples/lambda-rds-iam-auth/Cargo.toml +++ b/examples/lambda-rds-iam-auth/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde_json = "1.0.137" -aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } -aws-credential-types = "1.2.1" -aws-sigv4 = "1.2.7" +serde_json = "1.0.140" +aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } +aws-credential-types = "1.2.3" +aws-sigv4 = "1.3.3" url = "2.5.4" -tokio = { version = "1.43.0", features = ["full"] } -sqlx = { version = "0.8.3", features = ["tls-rustls", "postgres", "runtime-tokio"] } +tokio = { version = "1.46.1", features = ["full"] } +sqlx = { version = "0.8.6", features = ["tls-rustls", "postgres", "runtime-tokio"] } From 6b5bb6e4dd0bcfab0ea35bf1f9d73665c85d6678 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 06:35:52 +0200 Subject: [PATCH 15/21] update --- .../Cargo.toml | 2 +- .../consumer/Cargo.toml | 2 +- .../Cargo.toml | 4 ++-- examples/lambda-rds-iam-auth/src/main.rs | 18 +++++------------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/examples/advanced-appconfig-feature-flags/Cargo.toml b/examples/advanced-appconfig-feature-flags/Cargo.toml index cd11b162..51b708ec 100644 --- a/examples/advanced-appconfig-feature-flags/Cargo.toml +++ b/examples/advanced-appconfig-feature-flags/Cargo.toml @@ -16,7 +16,7 @@ edition = "2021" [dependencies] async-trait = "0.1.88" -lambda_runtime = { path = "../../../lambda-runtime" } +lambda_runtime = { path = "../../lambda-runtime" } reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 48fc3437..e82dc1d3 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] #aws dependencies -aws_lambda_events = { version = "0.16.1", features = ["sqs"], default-features = false } +aws_lambda_events = { path = "../../../lambda-events", features = ["sqs"], default-features = false } #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index 86533b4b..8c8b655b 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws_lambda_events = "0.16.1" +aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } aws-config = { version = "1.8.1", features = ["behavior-version-latest"] } @@ -23,7 +23,7 @@ aws-sdk-s3 = "1.96.0" thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.88" -ureq = "3.0.12" +ureq = "2.12.1" [dev-dependencies] serde_json = "1.0.140" diff --git a/examples/lambda-rds-iam-auth/src/main.rs b/examples/lambda-rds-iam-auth/src/main.rs index 32cf3580..5f787e01 100644 --- a/examples/lambda-rds-iam-auth/src/main.rs +++ b/examples/lambda-rds-iam-auth/src/main.rs @@ -12,12 +12,8 @@ use std::time::{Duration, SystemTime}; const RDS_CERTS: &[u8] = include_bytes!("global-bundle.pem"); -async fn generate_rds_iam_token( - db_hostname: &str, - port: u16, - db_username: &str, -) -> Result { - let config = aws_config::load_defaults(BehaviorVersion::v2024_03_28()).await; +async fn generate_rds_iam_token(db_hostname: &str, port: u16, db_username: &str) -> Result { + let config = aws_config::load_defaults(BehaviorVersion::latest()).await; let credentials = config .credentials_provider() @@ -48,11 +44,9 @@ async fn generate_rds_iam_token( ); let signable_request = - SignableRequest::new("GET", &url, std::iter::empty(), SignableBody::Bytes(&[])) - .expect("signable request"); + SignableRequest::new("GET", &url, std::iter::empty(), SignableBody::Bytes(&[])).expect("signable request"); - let (signing_instructions, _signature) = - sign(signable_request, &signing_params.into())?.into_parts(); + let (signing_instructions, _signature) = sign(signable_request, &signing_params.into())?.into_parts(); let mut url = url::Url::parse(&url).unwrap(); for (name, value) in signing_instructions.params() { @@ -89,9 +83,7 @@ async fn handler(_event: LambdaEvent) -> Result { .ssl_root_cert_from_pem(RDS_CERTS.to_vec()) .ssl_mode(sqlx::postgres::PgSslMode::Require); - let pool = sqlx::postgres::PgPoolOptions::new() - .connect_with(opts) - .await?; + let pool = sqlx::postgres::PgPoolOptions::new().connect_with(opts).await?; let result: i32 = sqlx::query_scalar("SELECT $1 + $2") .bind(3) From 2e202b731fe728b25abe9d6d89c7c0be439df845 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 06:46:33 +0200 Subject: [PATCH 16/21] update ureq --- examples/basic-s3-object-lambda-thumbnail/Cargo.toml | 2 +- examples/basic-s3-object-lambda-thumbnail/src/s3.rs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index 8c8b655b..09d8a4b2 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -23,7 +23,7 @@ aws-sdk-s3 = "1.96.0" thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.88" -ureq = "2.12.1" +ureq = "3.0.12" [dev-dependencies] serde_json = "1.0.140" diff --git a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs index 0b4967d3..69b46ec2 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs @@ -19,12 +19,17 @@ impl GetFile for S3Client { fn get_file(&self, url: String) -> Result, Box> { tracing::info!("get file url {}", url); - let resp = ureq::get(&url).call()?; - let len: usize = resp.header("Content-Length").unwrap().parse()?; + let mut res = ureq::get(&url).call()?; + let len: usize = res + .headers() + .get("Content-Length") + .and_then(|h| h.to_str().ok()) + .and_then(|s| s.parse().ok()) + .unwrap(); let mut bytes: Vec = Vec::with_capacity(len); - std::io::Read::take(resp.into_reader(), 10_000_000).read_to_end(&mut bytes)?; + std::io::Read::take(res.body_mut().as_reader(), 10_000_000).read_to_end(&mut bytes)?; tracing::info!("got {} bytes", bytes.len()); From 76fdbc03fbcf53b00a080ed614b389d83caf705e Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 06:50:08 +0200 Subject: [PATCH 17/21] space --- lambda-runtime/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index aafffcb9..6e0dde73 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -37,7 +37,6 @@ http = { workspace = true } http-body-util = { workspace = true } http-serde = { workspace = true } hyper = { workspace = true, features = ["http1", "client"] } - lambda-extension = { version = "0.12.1", path = "../lambda-extension", default-features = false, optional = true } lambda_runtime_api_client = { version = "0.12.2", path = "../lambda-runtime-api-client", default-features = false } miette = { version = "7.2.0", optional = true } From 31335094580abb8ef400ae471bc7206e258f9ad5 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 06:53:20 +0200 Subject: [PATCH 18/21] fmt --- .../basic-error-error-crates-integration/src/main.rs | 2 +- .../basic-s3-object-lambda-thumbnail/src/main.rs | 12 ++++-------- examples/basic-s3-thumbnail/src/main.rs | 9 ++------- examples/extension-internal-flush/src/main.rs | 6 ++++-- examples/http-axum-diesel-ssl/src/main.rs | 6 ++---- examples/http-axum-middleware/src/main.rs | 3 +-- examples/http-axum/src/main.rs | 5 ++--- examples/http-tower-trace/src/main.rs | 9 ++++++--- examples/lambda-rds-iam-auth/src/main.rs | 6 ++++-- 9 files changed, 26 insertions(+), 32 deletions(-) diff --git a/examples/basic-error-error-crates-integration/src/main.rs b/examples/basic-error-error-crates-integration/src/main.rs index f4048584..176bd54b 100644 --- a/examples/basic-error-error-crates-integration/src/main.rs +++ b/examples/basic-error-error-crates-integration/src/main.rs @@ -28,7 +28,7 @@ fn miette_error() -> miette::Result<()> { /// Transform an anyhow::Error, eyre::Report, or miette::Report into a lambda_runtime::Diagnostic. /// It does it by enabling the feature `anyhow`, `eyre` or `miette` in the runtime dependency. -/// Those features enable the implementation of `From for Diagnostic` +/// Those features enable the implementation of `From for Diagnostic` /// for `anyhow::Error`, `eyre::Report`, and `miette::Report`. async fn function_handler(event: LambdaEvent) -> Result<(), Diagnostic> { match event.payload.error_type { diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index b34122a1..0aae00fe 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -84,16 +84,12 @@ fn get_thumbnail(vec: Vec, _size: u32) -> Vec { mod tests { use super::*; use async_trait::async_trait; - use aws_lambda_events::s3::object_lambda::Configuration; - use aws_lambda_events::s3::object_lambda::HeadObjectContext; - use aws_lambda_events::s3::object_lambda::ListObjectsContext; - use aws_lambda_events::s3::object_lambda::ListObjectsV2Context; - use aws_lambda_events::s3::object_lambda::UserIdentity; - use aws_lambda_events::s3::object_lambda::UserRequest; + use aws_lambda_events::s3::object_lambda::{ + Configuration, HeadObjectContext, ListObjectsContext, ListObjectsV2Context, UserIdentity, UserRequest, + }; use lambda_runtime::{Context, LambdaEvent}; use mockall::mock; - use s3::GetFile; - use s3::SendFile; + use s3::{GetFile, SendFile}; use serde_json::json; #[tokio::test] diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 8cfbce62..65972d49 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -139,16 +139,11 @@ mod tests { use super::*; use async_trait::async_trait; //use aws_lambda_events::chrono::DateTime; - use aws_lambda_events::s3::S3Bucket; - use aws_lambda_events::s3::S3Entity; - use aws_lambda_events::s3::S3Object; - use aws_lambda_events::s3::S3RequestParameters; - use aws_lambda_events::s3::S3UserIdentity; + use aws_lambda_events::s3::{S3Bucket, S3Entity, S3Object, S3RequestParameters, S3UserIdentity}; use aws_sdk_s3::operation::get_object::GetObjectError; use lambda_runtime::{Context, LambdaEvent}; use mockall::mock; - use s3::GetFile; - use s3::PutFile; + use s3::{GetFile, PutFile}; #[tokio::test] async fn response_is_good() { diff --git a/examples/extension-internal-flush/src/main.rs b/examples/extension-internal-flush/src/main.rs index 9a515ff8..d20213e1 100644 --- a/examples/extension-internal-flush/src/main.rs +++ b/examples/extension-internal-flush/src/main.rs @@ -2,8 +2,10 @@ use anyhow::anyhow; use aws_lambda_events::sqs::{SqsBatchResponse, SqsEventObj}; use lambda_extension::{service_fn, tracing, Error, Extension, NextEvent}; use serde::{Deserialize, Serialize}; -use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}; -use tokio::sync::Mutex; +use tokio::sync::{ + mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}, + Mutex, +}; use std::sync::Arc; diff --git a/examples/http-axum-diesel-ssl/src/main.rs b/examples/http-axum-diesel-ssl/src/main.rs index b71665a3..395c1843 100755 --- a/examples/http-axum-diesel-ssl/src/main.rs +++ b/examples/http-axum-diesel-ssl/src/main.rs @@ -4,14 +4,12 @@ use axum::{ routing::get, Router, }; -use diesel::prelude::*; -use diesel::{ConnectionError, ConnectionResult}; +use diesel::{prelude::*, ConnectionError, ConnectionResult}; use diesel_async::{ pooled_connection::{bb8::Pool, AsyncDieselConnectionManager, ManagerConfig}, AsyncPgConnection, RunQueryDsl, }; -use futures_util::future::BoxFuture; -use futures_util::FutureExt; +use futures_util::{future::BoxFuture, FutureExt}; use lambda_http::{http::StatusCode, run, tracing, Error}; use serde::{Deserialize, Serialize}; use std::time::Duration; diff --git a/examples/http-axum-middleware/src/main.rs b/examples/http-axum-middleware/src/main.rs index b1e92811..e335c270 100644 --- a/examples/http-axum-middleware/src/main.rs +++ b/examples/http-axum-middleware/src/main.rs @@ -10,8 +10,7 @@ //! ``` use axum::{response::Json, routing::post, Router}; -use lambda_http::request::RequestContext::ApiGatewayV1; -use lambda_http::{run, tracing, Error}; +use lambda_http::{request::RequestContext::ApiGatewayV1, run, tracing, Error}; use serde_json::{json, Value}; // Sample middleware that logs the request id diff --git a/examples/http-axum/src/main.rs b/examples/http-axum/src/main.rs index dcd5d154..3b00fc57 100644 --- a/examples/http-axum/src/main.rs +++ b/examples/http-axum/src/main.rs @@ -6,10 +6,9 @@ //! implementation to the Lambda runtime to run as a Lambda function. By using Axum instead //! of a basic `tower::Service` you get web framework niceties like routing, request component //! extraction, validation, etc. -use axum::extract::Query; -use axum::http::StatusCode; use axum::{ - extract::Path, + extract::{Path, Query}, + http::StatusCode, response::Json, routing::{get, post}, Router, diff --git a/examples/http-tower-trace/src/main.rs b/examples/http-tower-trace/src/main.rs index df2b9007..7dd0c1d6 100644 --- a/examples/http-tower-trace/src/main.rs +++ b/examples/http-tower-trace/src/main.rs @@ -1,6 +1,9 @@ -use lambda_http::tracing::{self, Level}; -use lambda_http::{run, tower::ServiceBuilder, Error}; -use lambda_http::{Request, Response}; +use lambda_http::{ + run, + tower::ServiceBuilder, + tracing::{self, Level}, + Error, Request, Response, +}; use tower_http::trace::{DefaultOnRequest, DefaultOnResponse, TraceLayer}; async fn handler(_req: Request) -> Result, Error> { diff --git a/examples/lambda-rds-iam-auth/src/main.rs b/examples/lambda-rds-iam-auth/src/main.rs index 5f787e01..0dd2336e 100644 --- a/examples/lambda-rds-iam-auth/src/main.rs +++ b/examples/lambda-rds-iam-auth/src/main.rs @@ -7,8 +7,10 @@ use aws_sigv4::{ use lambda_runtime::{run, service_fn, Error, LambdaEvent}; use serde_json::{json, Value}; use sqlx::postgres::PgConnectOptions; -use std::env; -use std::time::{Duration, SystemTime}; +use std::{ + env, + time::{Duration, SystemTime}, +}; const RDS_CERTS: &[u8] = include_bytes!("global-bundle.pem"); From 0eb37b2a033c1efe485285562681593ba1964fce Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 07:02:17 +0200 Subject: [PATCH 19/21] clippy --- .../advanced-appconfig-feature-flags/src/main.rs | 4 ++-- .../src/main.rs | 4 ++-- examples/basic-error-handling/src/main.rs | 8 ++++---- examples/basic-error-thiserror/src/main.rs | 3 +-- examples/basic-lambda-external-runtime/src/main.rs | 4 ++-- examples/basic-lambda/src/main.rs | 2 +- .../basic-s3-object-lambda-thumbnail/src/main.rs | 6 +++--- examples/basic-s3-thumbnail/src/main.rs | 14 +++++++------- examples/basic-s3-thumbnail/src/s3.rs | 2 +- examples/basic-sdk/src/main.rs | 2 +- examples/basic-streaming-response/src/main.rs | 2 +- examples/http-cors/src/main.rs | 2 +- examples/http-query-parameters/src/main.rs | 2 +- examples/lambda-rds-iam-auth/src/main.rs | 9 +++------ 14 files changed, 30 insertions(+), 34 deletions(-) diff --git a/examples/advanced-appconfig-feature-flags/src/main.rs b/examples/advanced-appconfig-feature-flags/src/main.rs index b7d5e515..87ec54fa 100644 --- a/examples/advanced-appconfig-feature-flags/src/main.rs +++ b/examples/advanced-appconfig-feature-flags/src/main.rs @@ -35,9 +35,9 @@ async fn function_handler( // Use the feature flag let msg = if config.spanish_response { - format!("{}, in spanish.", quote) + format!("{quote}, in spanish.") } else { - format!("{}.", quote) + format!("{quote}.") }; // Return `Response` (it will be serialized to JSON automatically by the runtime) diff --git a/examples/advanced-sqs-partial-batch-failures/src/main.rs b/examples/advanced-sqs-partial-batch-failures/src/main.rs index be4eb66f..6cea2f93 100644 --- a/examples/advanced-sqs-partial-batch-failures/src/main.rs +++ b/examples/advanced-sqs-partial-batch-failures/src/main.rs @@ -55,7 +55,7 @@ where D: DeserializeOwned, R: Future>, { - run(service_fn(|e| batch_handler(|d| f(d), e))).await + run(service_fn(|e| batch_handler(&f, e))).await } /// Helper function to lift the user provided `f` function from message to batch of messages. @@ -123,7 +123,7 @@ mod test { } #[tokio::test] - async fn test() -> () { + async fn test() { let msg_to_fail: SqsMessageObj = serde_json::from_str( r#"{ "messageId": "1", diff --git a/examples/basic-error-handling/src/main.rs b/examples/basic-error-handling/src/main.rs index 12c954a9..85e97428 100644 --- a/examples/basic-error-handling/src/main.rs +++ b/examples/basic-error-handling/src/main.rs @@ -43,7 +43,7 @@ impl std::fmt::Display for CustomError { /// Display the error struct as a JSON string fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let err_as_json = json!(self).to_string(); - write!(f, "{}", err_as_json) + write!(f, "{err_as_json}") } } @@ -66,7 +66,7 @@ pub(crate) async fn func(event: LambdaEvent) -> Result match event.event_type { EventType::SimpleError => { // generate a simple text message error using `simple_error` crate - return Err(Box::new(simple_error::SimpleError::new("A simple error as requested!"))); + Err(Box::new(simple_error::SimpleError::new("A simple error as requested!"))) } EventType::CustomError => { // generate a custom error using our own structure @@ -75,7 +75,7 @@ pub(crate) async fn func(event: LambdaEvent) -> Result req_id: ctx.request_id, msg: "A custom error as requested!".into(), }; - return Err(Box::new(cust_err)); + Err(Box::new(cust_err)) } EventType::ExternalError => { // try to open a non-existent file to get an error and propagate it with `?` @@ -94,7 +94,7 @@ pub(crate) async fn func(event: LambdaEvent) -> Result msg: "OK".into(), }; - return Ok(resp); + Ok(resp) } } } diff --git a/examples/basic-error-thiserror/src/main.rs b/examples/basic-error-thiserror/src/main.rs index 403309bf..2c01b833 100644 --- a/examples/basic-error-thiserror/src/main.rs +++ b/examples/basic-error-thiserror/src/main.rs @@ -1,6 +1,5 @@ use lambda_runtime::{service_fn, Diagnostic, Error, LambdaEvent}; use serde::Deserialize; -use thiserror; #[derive(Deserialize)] struct Request {} @@ -21,7 +20,7 @@ impl From for Diagnostic { }; Diagnostic { error_type: error_type.into(), - error_message: error_message.into(), + error_message, } } } diff --git a/examples/basic-lambda-external-runtime/src/main.rs b/examples/basic-lambda-external-runtime/src/main.rs index bd3b4e6c..87891ebc 100644 --- a/examples/basic-lambda-external-runtime/src/main.rs +++ b/examples/basic-lambda-external-runtime/src/main.rs @@ -53,7 +53,7 @@ fn main() -> Result<(), io::Error> { my_runtime(move || future::block_on(app_runtime_task(lambda_rx.clone(), shutdown_tx.clone()))); // Block the main thread until a shutdown signal is received. - future::block_on(shutdown_rx.recv()).map_err(|err| io::Error::new(io::ErrorKind::Other, format!("{:?}", err))) + future::block_on(shutdown_rx.recv()).map_err(|err| io::Error::other(format!("{err:?}"))) } pub(crate) async fn my_handler(event: LambdaEvent) -> Result { @@ -63,7 +63,7 @@ pub(crate) async fn my_handler(event: LambdaEvent) -> Result) -> Result S3ObjectLambdaEvent { - return S3ObjectLambdaEvent { + S3ObjectLambdaEvent { x_amz_request_id: ("ID".to_string()), head_object_context: (Some(HeadObjectContext::default())), list_objects_context: (Some(ListObjectsContext::default())), @@ -146,6 +146,6 @@ mod tests { supporting_access_point_arn: ("SAPRN".to_string()), payload: (json!(null)), }), - }; + } } } diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 65972d49..e8e71ffb 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -174,22 +174,22 @@ mod tests { mock.expect_put_file() .withf(|bu, ke, by| { - return bu.eq("test-bucket-thumbs") && ke.eq(key) && by.eq("THUMBNAIL".as_bytes()); + bu.eq("test-bucket-thumbs") && ke.eq(key) && by.eq("THUMBNAIL".as_bytes()) }) .return_const(Ok("Done".to_string())); let payload = get_s3_event("ObjectCreated", bucket, key); let event = LambdaEvent { payload, context }; - let result = function_handler(event, 10, &mock).await.unwrap(); + function_handler(event, 10, &mock).await.unwrap(); - assert_eq!((), result); + assert_eq!((), ()); } fn get_s3_event(event_name: &str, bucket_name: &str, object_key: &str) -> S3Event { - return S3Event { + S3Event { records: (vec![get_s3_event_record(event_name, bucket_name, object_key)]), - }; + } } fn get_s3_event_record(event_name: &str, bucket_name: &str, object_key: &str) -> S3EventRecord { @@ -213,7 +213,7 @@ mod tests { }), }; - return S3EventRecord { + S3EventRecord { event_version: (Some(String::default())), event_source: (Some(String::default())), aws_region: (Some(String::default())), @@ -227,6 +227,6 @@ mod tests { }), response_elements: (HashMap::new()), s3: (s3_entity), - }; + } } } diff --git a/examples/basic-s3-thumbnail/src/s3.rs b/examples/basic-s3-thumbnail/src/s3.rs index b8f8efa0..1a759371 100644 --- a/examples/basic-s3-thumbnail/src/s3.rs +++ b/examples/basic-s3-thumbnail/src/s3.rs @@ -43,7 +43,7 @@ impl PutFile for S3Client { let result = self.put_object().bucket(bucket).key(key).body(bytes).send().await; match result { - Ok(_) => Ok(format!("Uploaded a file with key {} into {}", key, bucket)), + Ok(_) => Ok(format!("Uploaded a file with key {key} into {bucket}")), Err(err) => Err(err.into_service_error().meta().message().unwrap().to_string()), } } diff --git a/examples/basic-sdk/src/main.rs b/examples/basic-sdk/src/main.rs index 6bdd4045..a021f4c2 100644 --- a/examples/basic-sdk/src/main.rs +++ b/examples/basic-sdk/src/main.rs @@ -52,7 +52,7 @@ async fn my_handler(event: LambdaEvent, client: &T) -> let objects_rsp = client.list_objects(&bucket).await?; let objects: Vec<_> = objects_rsp .contents() - .into_iter() + .iter() .filter_map(|o| o.key().map(|k| k.to_string())) .collect(); diff --git a/examples/basic-streaming-response/src/main.rs b/examples/basic-streaming-response/src/main.rs index 8533c8e3..fe112b80 100644 --- a/examples/basic-streaming-response/src/main.rs +++ b/examples/basic-streaming-response/src/main.rs @@ -7,7 +7,7 @@ use serde_json::Value; use std::{thread, time::Duration}; async fn func(_event: LambdaEvent) -> Result, Error> { - let messages = vec!["Hello", "world", "from", "Lambda!"]; + let messages = ["Hello", "world", "from", "Lambda!"]; let (mut tx, rx) = channel(); diff --git a/examples/http-cors/src/main.rs b/examples/http-cors/src/main.rs index ffac0a9e..4c2c54b4 100644 --- a/examples/http-cors/src/main.rs +++ b/examples/http-cors/src/main.rs @@ -28,7 +28,7 @@ async fn func(event: Request) -> Result, Error> { .query_string_parameters_ref() .and_then(|params| params.first("first_name")) { - Some(first_name) => format!("Hello, {}!", first_name).into_response().await, + Some(first_name) => format!("Hello, {first_name}!").into_response().await, None => Response::builder() .status(400) .body("Empty first name".into()) diff --git a/examples/http-query-parameters/src/main.rs b/examples/http-query-parameters/src/main.rs index ef9cf658..c974e633 100644 --- a/examples/http-query-parameters/src/main.rs +++ b/examples/http-query-parameters/src/main.rs @@ -11,7 +11,7 @@ async fn function_handler(event: Request) -> Result { .query_string_parameters_ref() .and_then(|params| params.first("first_name")) { - Some(first_name) => format!("Hello, {}!", first_name).into_response().await, + Some(first_name) => format!("Hello, {first_name}!").into_response().await, None => Response::builder() .status(400) .body("Empty first name".into()) diff --git a/examples/lambda-rds-iam-auth/src/main.rs b/examples/lambda-rds-iam-auth/src/main.rs index 0dd2336e..695aa343 100644 --- a/examples/lambda-rds-iam-auth/src/main.rs +++ b/examples/lambda-rds-iam-auth/src/main.rs @@ -39,10 +39,7 @@ async fn generate_rds_iam_token(db_hostname: &str, port: u16, db_username: &str) .build()?; let url = format!( - "https://{db_hostname}:{port}/?Action=connect&DBUser={db_user}", - db_hostname = db_hostname, - port = port, - db_user = db_username + "https://{db_hostname}:{port}/?Action=connect&DBUser={db_username}" ); let signable_request = @@ -52,7 +49,7 @@ async fn generate_rds_iam_token(db_hostname: &str, port: u16, db_username: &str) let mut url = url::Url::parse(&url).unwrap(); for (name, value) in signing_instructions.params() { - url.query_pairs_mut().append_pair(name, &value); + url.query_pairs_mut().append_pair(name, value); } let response = url.to_string().split_off("https://".len()); @@ -93,7 +90,7 @@ async fn handler(_event: LambdaEvent) -> Result { .fetch_one(&pool) .await?; - println!("Result: {:?}", result); + println!("Result: {result:?}"); Ok(json!({ "statusCode": 200, From 78afa957b12c9260de6d2637cf8577afffc66e3b Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 07:08:52 +0200 Subject: [PATCH 20/21] update otel --- examples/opentelemetry-tracing/Cargo.toml | 8 ++++---- examples/opentelemetry-tracing/src/main.rs | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/opentelemetry-tracing/Cargo.toml b/examples/opentelemetry-tracing/Cargo.toml index 9aea3907..c9b2a9cb 100644 --- a/examples/opentelemetry-tracing/Cargo.toml +++ b/examples/opentelemetry-tracing/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime", features = ["opentelemetry"] } -opentelemetry = "0.27" -opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } -opentelemetry-stdout = { version = "0.27", features = ["trace"] } +opentelemetry = "0.30" +opentelemetry_sdk = { version = "0.30", features = ["rt-tokio"] } +opentelemetry-stdout = { version = "0.30", features = ["trace"] } serde_json = "1.0" tokio = "1" tower = "0.5" tracing = "0.1" -tracing-opentelemetry = "0.28" +tracing-opentelemetry = "0.31" tracing-subscriber = "0.3" diff --git a/examples/opentelemetry-tracing/src/main.rs b/examples/opentelemetry-tracing/src/main.rs index 062f5a11..a75aa016 100644 --- a/examples/opentelemetry-tracing/src/main.rs +++ b/examples/opentelemetry-tracing/src/main.rs @@ -4,7 +4,7 @@ use lambda_runtime::{ LambdaEvent, Runtime, }; use opentelemetry::trace::TracerProvider; -use opentelemetry_sdk::{runtime, trace}; +use opentelemetry_sdk::trace; use tower::{service_fn, BoxError}; use tracing_subscriber::prelude::*; @@ -18,8 +18,8 @@ async fn echo(event: LambdaEvent) -> Result Result<(), BoxError> { // Set up OpenTelemetry tracer provider that writes spans to stdout for debugging purposes let exporter = opentelemetry_stdout::SpanExporter::default(); - let tracer_provider = trace::TracerProvider::builder() - .with_batch_exporter(exporter, runtime::Tokio) + let tracer_provider = trace::SdkTracerProvider::builder() + .with_batch_exporter(exporter) .build(); // Set up link between OpenTelemetry and tracing crate @@ -34,7 +34,9 @@ async fn main() -> Result<(), BoxError> { // Create a tracing span for each Lambda invocation OtelLayer::new(|| { // Make sure that the trace is exported before the Lambda runtime is frozen - tracer_provider.force_flush(); + if let Err(err) = tracer_provider.force_flush() { + eprintln!("Error flushing traces: {err:#?}"); + } }) // Set the "faas.trigger" attribute of the span to "pubsub" .with_trigger(OpenTelemetryFaasTrigger::PubSub), From 802cf933b09387040f48c45a380865eada5f775c Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Thu, 10 Jul 2025 07:17:44 +0200 Subject: [PATCH 21/21] fmt --- examples/basic-s3-object-lambda-thumbnail/src/main.rs | 4 +--- examples/basic-s3-thumbnail/src/main.rs | 4 +--- examples/lambda-rds-iam-auth/src/main.rs | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index 3a784dca..699fb044 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -113,9 +113,7 @@ mod tests { .returning(|_1| Ok("IMAGE".into())); mock.expect_send_file() - .withf(|r, t, by| { - r.eq("O_ROUTE") && t.eq("O_TOKEN") && by == "THUMBNAIL".as_bytes() - }) + .withf(|r, t, by| r.eq("O_ROUTE") && t.eq("O_TOKEN") && by == "THUMBNAIL".as_bytes()) .returning(|_1, _2, _3| Ok("File sent.".to_string())); let payload = get_s3_event(); diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index e8e71ffb..d09da116 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -173,9 +173,7 @@ mod tests { .returning(|_1, _2| Ok("IMAGE".into())); mock.expect_put_file() - .withf(|bu, ke, by| { - bu.eq("test-bucket-thumbs") && ke.eq(key) && by.eq("THUMBNAIL".as_bytes()) - }) + .withf(|bu, ke, by| bu.eq("test-bucket-thumbs") && ke.eq(key) && by.eq("THUMBNAIL".as_bytes())) .return_const(Ok("Done".to_string())); let payload = get_s3_event("ObjectCreated", bucket, key); diff --git a/examples/lambda-rds-iam-auth/src/main.rs b/examples/lambda-rds-iam-auth/src/main.rs index 695aa343..fbf8394f 100644 --- a/examples/lambda-rds-iam-auth/src/main.rs +++ b/examples/lambda-rds-iam-auth/src/main.rs @@ -38,9 +38,7 @@ async fn generate_rds_iam_token(db_hostname: &str, port: u16, db_username: &str) .settings(signing_settings) .build()?; - let url = format!( - "https://{db_hostname}:{port}/?Action=connect&DBUser={db_username}" - ); + let url = format!("https://{db_hostname}:{port}/?Action=connect&DBUser={db_username}"); let signable_request = SignableRequest::new("GET", &url, std::iter::empty(), SignableBody::Bytes(&[])).expect("signable request");