From f003dd6ad5afa8cb8fb29f4020055c963c39db17 Mon Sep 17 00:00:00 2001 From: Anna Khanova <32508607+khanova@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:20:53 +0100 Subject: [PATCH] Remove rename in parameters (#6411) ## Problem Name in notifications is not compatible with console name. ## Summary of changes Rename fields to make it compatible. --- proxy/src/redis/notifications.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/proxy/src/redis/notifications.rs b/proxy/src/redis/notifications.rs index 933f2a1bdb..d28dcbd1a7 100644 --- a/proxy/src/redis/notifications.rs +++ b/proxy/src/redis/notifications.rs @@ -46,14 +46,11 @@ enum Notification { } #[derive(Clone, Debug, Deserialize, Eq, PartialEq)] struct AllowedIpsUpdate { - #[serde(rename = "project")] project_id: SmolStr, } #[derive(Clone, Debug, Deserialize, Eq, PartialEq)] struct PasswordUpdate { - #[serde(rename = "project")] project_id: SmolStr, - #[serde(rename = "role")] role_name: SmolStr, } fn deserialize_json_string<'de, D, T>(deserializer: D) -> Result @@ -151,7 +148,7 @@ mod tests { #[test] fn parse_allowed_ips() -> anyhow::Result<()> { let project_id = "new_project".to_string(); - let data = format!("{{\"project\": \"{project_id}\"}}"); + let data = format!("{{\"project_id\": \"{project_id}\"}}"); let text = json!({ "type": "message", "topic": "/allowed_ips_updated", @@ -177,7 +174,7 @@ mod tests { fn parse_password_updated() -> anyhow::Result<()> { let project_id = "new_project".to_string(); let role_name = "new_role".to_string(); - let data = format!("{{\"project\": \"{project_id}\", \"role\": \"{role_name}\"}}"); + let data = format!("{{\"project_id\": \"{project_id}\", \"role_name\": \"{role_name}\"}}"); let text = json!({ "type": "message", "topic": "/password_updated",