Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update all dependencies and fix examples #959

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ 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",
] }
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"
Expand Down
6 changes: 3 additions & 3 deletions examples/advanced-appconfig-feature-flags/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ 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_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false }

#lambda runtime
lambda_runtime = { path = "../../../lambda-runtime" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ 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 = { version = "1.5.14", features = ["behavior-version-latest"] }
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" }
pizza_lib = { path = "../pizza_lib" }
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions examples/advanced-sqs-partial-batch-failures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ edition = "2021"

[dependencies]
serde = "^1"
serde_derive = "^1"
serde_with = { version = "^2", features = ["json"], optional = true }
serde_json = "^1"
aws_lambda_events = { path = "../../lambda-events" }
lambda_runtime = { path = "../../lambda-runtime" }
Expand Down
4 changes: 2 additions & 2 deletions examples/basic-cognito-post-confirmation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { 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"] }

lambda_runtime = { path = "../../lambda-runtime" }
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-error-error-crates-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
6 changes: 3 additions & 3 deletions examples/basic-error-handling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion examples/basic-error-thiserror/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
11 changes: 4 additions & 7 deletions examples/basic-lambda-external-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ 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"

[dev-dependencies]
tokio-test = "0.4.2"
serde = "1.0.217"
tokio = "1.43.0"
5 changes: 1 addition & 4 deletions examples/basic-lambda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ 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"
19 changes: 8 additions & 11 deletions examples/basic-s3-object-lambda-thumbnail/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ 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 = { version = "1.5.14", features = ["behavior-version-latest"] }
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"

[dev-dependencies]
mockall = "0.11.3"
tokio-test = "0.4.2"
serde_json = "1.0.137"
mockall = "0.13.1"
7 changes: 3 additions & 4 deletions examples/basic-s3-object-lambda-thumbnail/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<u8>, Box<dyn error::Error>>;
fn get_file(&self, url: String) -> Result<Vec<u8>, Box<dyn error::Error>>;
}
#[async_trait]
impl SendFile for FakeS3Client {
pub async fn send_file(&self, route: String, token: String, vec: Vec<u8>) -> Result<String, Box<dyn error::Error>>;
async fn send_file(&self, route: String, token: String, vec: Vec<u8>) -> Result<String, Box<dyn error::Error>>;
}
}

Expand Down
21 changes: 11 additions & 10 deletions examples/basic-s3-object-lambda-thumbnail/src/s3.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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())
Expand All @@ -65,16 +66,16 @@ fn check_error(error: SdkError<WriteGetObjectResponseError>) {
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"),
Expand Down
14 changes: 5 additions & 9 deletions examples/basic-s3-thumbnail/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "0.55"
aws-smithy-http = "0.55.3"
aws-sdk-s3 = "0.28"
aws-config = { version = "1.5.14", features = ["behavior-version-latest"] }
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"

[dev-dependencies]
mockall = "0.11"
tokio-test = "0.4"
mockall = "0.13.1"
chrono = "0.4"
4 changes: 2 additions & 2 deletions examples/basic-s3-thumbnail/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ mod tests {

#[async_trait]
impl GetFile for FakeS3Client {
pub async fn get_file(&self, bucket: &str, key: &str) -> Result<Vec<u8>, GetObjectError>;
async fn get_file(&self, bucket: &str, key: &str) -> Result<Vec<u8>, GetObjectError>;
}
#[async_trait]
impl PutFile for FakeS3Client {
pub async fn put_file(&self, bucket: &str, key: &str, bytes: Vec<u8>) -> Result<String, String>;
async fn put_file(&self, bucket: &str, key: &str, bytes: Vec<u8>) -> Result<String, String>;
}
}

Expand Down
4 changes: 1 addition & 3 deletions examples/basic-s3-thumbnail/src/s3.rs
Original file line number Diff line number Diff line change
@@ -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::{operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client};
use lambda_runtime::tracing;

#[async_trait]
Expand Down
9 changes: 4 additions & 5 deletions examples/basic-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ edition = "2021"

[dependencies]
async-trait = "0.1"
aws-config = "0.54"
aws-sdk-s3 = "0.24"
aws-config = { version = "1.5.14", features = ["behavior-version-latest"] }
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"
mockall = "0.13.1"
5 changes: 2 additions & 3 deletions examples/basic-sdk/src/main.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -52,7 +52,6 @@ async fn my_handler<T: ListObjects>(event: LambdaEvent<Request>, 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();
Expand All @@ -71,7 +70,7 @@ async fn my_handler<T: ListObjects>(event: LambdaEvent<Request>, 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;

Expand Down
2 changes: 1 addition & 1 deletion examples/basic-shared-resource/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion examples/basic-sqs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
1 change: 0 additions & 1 deletion examples/extension-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ edition = "2021"

[dependencies]
lambda-extension = { path = "../../lambda-extension" }
serde = "1.0.136"
tokio = { version = "1", features = ["macros"] }
1 change: 0 additions & 1 deletion examples/extension-combined/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ edition = "2021"

[dependencies]
lambda-extension = { path = "../../lambda-extension" }
serde = "1.0.136"
tokio = { version = "1", features = ["macros"] }
1 change: 0 additions & 1 deletion examples/extension-custom-events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ edition = "2021"

[dependencies]
lambda-extension = { path = "../../lambda-extension" }
serde = "1.0.136"
tokio = { version = "1", features = ["macros"] }
1 change: 0 additions & 1 deletion examples/extension-custom-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ edition = "2021"

[dependencies]
lambda-extension = { path = "../../lambda-extension" }
serde = "1.0.136"
tokio = { version = "1", features = ["macros"] }
2 changes: 1 addition & 1 deletion examples/extension-internal-flush/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
1 change: 0 additions & 1 deletion examples/extension-logs-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ edition = "2021"

[dependencies]
lambda-extension = { path = "../../lambda-extension" }
serde = "1.0.136"
tokio = { version = "1", features = ["macros", "rt"] }
Loading