Skip to content

Commit 1e2f782

Browse files
authored
Fix cognito metadata (#564)
* Fix Cognito's serialization format Signed-off-by: David Calavera <david.calavera@gmail.com> * Fix Identity and Client metadata Signed-off-by: David Calavera <david.calavera@gmail.com> Signed-off-by: David Calavera <david.calavera@gmail.com>
1 parent 996fb9b commit 1e2f782

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lambda-runtime/src/types.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,31 @@ pub struct ClientContext {
5757
#[serde(rename_all = "camelCase")]
5858
pub struct ClientApplication {
5959
/// The mobile app installation id
60+
#[serde(alias = "installation_id")]
6061
pub installation_id: String,
6162
/// The app title for the mobile app as registered with AWS' mobile services.
63+
#[serde(alias = "app_title")]
6264
pub app_title: String,
6365
/// The version name of the application as registered with AWS' mobile services.
66+
#[serde(alias = "app_version_name")]
6467
pub app_version_name: String,
6568
/// The app version code.
69+
#[serde(alias = "app_version_code")]
6670
pub app_version_code: String,
6771
/// The package name for the mobile application invoking the function
72+
#[serde(alias = "app_package_name")]
6873
pub app_package_name: String,
6974
}
7075

7176
/// Cognito identity information sent with the event
7277
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
78+
#[serde(rename_all = "camelCase")]
7379
pub struct CognitoIdentity {
7480
/// The unique identity id for the Cognito credentials invoking the function.
81+
#[serde(alias = "cognitoIdentityId", alias = "identity_id")]
7582
pub identity_id: String,
7683
/// The identity pool id the caller is "registered" with.
84+
#[serde(alias = "cognitoIdentityPoolId", alias = "identity_pool_id")]
7785
pub identity_pool_id: String,
7886
}
7987

0 commit comments

Comments
 (0)