From efebff560daffce4d51880c6e4c02bf4b73350ba Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 21 Feb 2024 20:51:51 +0100 Subject: [PATCH] fix: fix app policy quote escaping --- backend/windmill-api/src/apps.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/backend/windmill-api/src/apps.rs b/backend/windmill-api/src/apps.rs index 943ce9c6a7..b280169560 100644 --- a/backend/windmill-api/src/apps.rs +++ b/backend/windmill-api/src/apps.rs @@ -800,19 +800,15 @@ async fn update_app( npolicy.on_behalf_of_email = Some(authed.email.clone()); sqlb.set( "policy", - &format!( - "'{}'", - serde_json::to_string(&json!(npolicy)).map_err(|e| { - Error::BadRequest(format!("failed to serialize policy: {}", e)) - })? - ), + quote(serde_json::to_string(&json!(npolicy)).map_err(|e| { + Error::BadRequest(format!("failed to serialize policy: {}", e)) + })?), ); } sqlb.returning("path"); let sql = sqlb.sql().map_err(|e| Error::InternalErr(e.to_string()))?; - tracing::error!("update_app sql: {}", sql); let npath_o: Option = sqlx::query_scalar(&sql).fetch_optional(&mut tx).await?; not_found_if_none(npath_o, "App", path)? } else {