Skip to content
Merged
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
2 changes: 1 addition & 1 deletion examples/basic-error-handling/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Request {
}

/// Event types that tell our Lambda what to do do.
#[derive(Deserialize, PartialEq)]
#[derive(Deserialize, Eq, PartialEq)]
enum EventType {
Response,
ExternalError,
Expand Down
2 changes: 1 addition & 1 deletion lambda-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-stream = "0.3"
bytes = "1.0"
chrono = { version = "0.4", features = ["serde"] }
http = "0.2"
hyper = { version = "0.14", features = ["http1", "client", "server", "stream", "runtime"] }
hyper = { version = "0.14.20", features = ["http1", "client", "server", "stream", "runtime"] }
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }
serde = { version = "1", features = ["derive"] }
serde_json = "^1"
Expand Down
2 changes: 1 addition & 1 deletion lambda-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ base64 = "0.13.0"
bytes = "1"
http = "0.2"
http-body = "0.4"
hyper = "0.14"
hyper = "0.14.20"
lambda_runtime = { path = "../lambda-runtime", version = "0.6" }
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
Expand Down
10 changes: 5 additions & 5 deletions lambda-http/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ mod tests {

#[test]
fn requests_have_form_post_parsable_payloads() {
#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, Eq, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
Expand All @@ -349,7 +349,7 @@ mod tests {

#[test]
fn requests_have_json_parseable_payloads() {
#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, Eq, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
Expand All @@ -370,7 +370,7 @@ mod tests {

#[test]
fn requests_match_form_post_content_type_with_charset() {
#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, Eq, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
Expand All @@ -391,7 +391,7 @@ mod tests {

#[test]
fn requests_match_json_content_type_with_charset() {
#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, Eq, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
Expand All @@ -412,7 +412,7 @@ mod tests {

#[test]
fn requests_omiting_content_types_do_not_support_parseable_payloads() {
#[derive(Deserialize, PartialEq, Debug)]
#[derive(Deserialize, Eq, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
Expand Down
2 changes: 1 addition & 1 deletion lambda-http/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pub enum RequestContext {
}

/// Converts LambdaRequest types into `http::Request<Body>` types
impl<'a> From<LambdaRequest> for http::Request<Body> {
impl From<LambdaRequest> for http::Request<Body> {
fn from(value: LambdaRequest) -> Self {
match value {
#[cfg(feature = "apigw_rest")]
Expand Down
2 changes: 1 addition & 1 deletion lambda-runtime-api-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ readme = "README.md"

[dependencies]
http = "0.2"
hyper = { version = "0.14", features = ["http1", "client", "stream", "tcp"] }
hyper = { version = "0.14.20", features = ["http1", "client", "stream", "tcp"] }
tower-service = "0.3"
tokio = { version = "1.0", features = ["io-util"] }
3 changes: 1 addition & 2 deletions lambda-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ simulated = []
[dependencies]
tokio = { version = "1.0", features = ["macros", "io-util", "sync", "rt-multi-thread"] }
# Hyper requires the `server` feature to work on nightly
hyper = { version = "0.14", features = ["http1", "client", "stream", "server"] }
hyper = { version = "0.14.20", features = ["http1", "client", "stream", "server"] }
serde = { version = "1", features = ["derive"] }
serde_json = "^1"
bytes = "1.0"
Expand All @@ -27,4 +27,3 @@ tracing = { version = "0.1", features = ["log"] }
tower = { version = "0.4", features = ["util"] }
tokio-stream = "0.1.2"
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }

2 changes: 1 addition & 1 deletion lambda-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use types::{Context, LambdaEvent};
pub type Error = lambda_runtime_api_client::Error;

/// Configuration derived from environment variables.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct Config {
/// The name of the function.
pub function_name: String,
Expand Down
4 changes: 2 additions & 2 deletions lambda-runtime/src/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) trait IntoResponse {
}

// /runtime/invocation/next
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, PartialEq)]
pub(crate) struct NextEventRequest;

impl IntoRequest for NextEventRequest {
Expand All @@ -27,7 +27,7 @@ impl IntoRequest for NextEventRequest {
}
}

#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, PartialEq)]
pub struct NextEventResponse<'a> {
// lambda-runtime-aws-request-id
pub request_id: &'a str,
Expand Down
22 changes: 11 additions & 11 deletions lambda-runtime/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use http::{HeaderMap, HeaderValue};
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom};

#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Diagnostic {
pub(crate) error_type: String,
Expand All @@ -28,33 +28,33 @@ fn round_trip_lambda_error() -> Result<(), Error> {
/// The request ID, which identifies the request that triggered the function invocation. This header
/// tracks the invocation within the Lambda control plane. The request ID is used to specify completion
/// of a given invocation.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct RequestId(pub String);

/// The date that the function times out in Unix time milliseconds. For example, `1542409706888`.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct InvocationDeadline(pub u64);

/// The ARN of the Lambda function, version, or alias that is specified in the invocation.
/// For instance, `arn:aws:lambda:us-east-2:123456789012:function:custom-runtime`.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct FunctionArn(pub String);

/// The AWS X-Ray Tracing header. For more information,
/// please see [AWS' documentation](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader).
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct XRayTraceId(pub String);

/// For invocations from the AWS Mobile SDK contains data about client application and device.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
struct MobileClientContext(String);

/// For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
struct MobileClientIdentity(String);

/// Client context sent by the AWS Mobile SDK.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
pub struct ClientContext {
/// Information about the mobile application invoking the function.
#[serde(default)]
Expand All @@ -68,7 +68,7 @@ pub struct ClientContext {
}

/// AWS Mobile SDK client fields.
#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Default, Clone, Debug, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ClientApplication {
/// The mobile app installation id
Expand All @@ -84,7 +84,7 @@ pub struct ClientApplication {
}

/// Cognito identity information sent with the event
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
pub struct CognitoIdentity {
/// The unique identity id for the Cognito credentials invoking the function.
pub identity_id: String,
Expand All @@ -96,7 +96,7 @@ pub struct CognitoIdentity {
/// are populated using the [Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html)
/// and the headers returned by the poll request to the Runtime APIs.
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)]
pub struct Context {
/// The AWS request ID generated by the Lambda service.
pub request_id: String,
Expand Down