From f1cf49067259c42f6a988ffe803d9358fba9bae0 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Wed, 30 Oct 2024 00:22:46 +0000 Subject: [PATCH] fix: Retain secret description when updating a secret Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- .../api/secrets/internal/routes/SecretDetailsRoute.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/galasa-parent/dev.galasa.framework.api.secrets/src/main/java/dev/galasa/framework/api/secrets/internal/routes/SecretDetailsRoute.java b/galasa-parent/dev.galasa.framework.api.secrets/src/main/java/dev/galasa/framework/api/secrets/internal/routes/SecretDetailsRoute.java index ee28146b..3707223a 100644 --- a/galasa-parent/dev.galasa.framework.api.secrets/src/main/java/dev/galasa/framework/api/secrets/internal/routes/SecretDetailsRoute.java +++ b/galasa-parent/dev.galasa.framework.api.secrets/src/main/java/dev/galasa/framework/api/secrets/internal/routes/SecretDetailsRoute.java @@ -112,7 +112,8 @@ public HttpServletResponse handlePutRequest( // A secret already exists and no type was given, so just update the secret by // overriding its existing values with the values provided in the request decodedSecret = getOverriddenSecret(existingSecretType, existingSecret, secretPayload); - setSecretMetadataProperties(decodedSecret, secretPayload.getdescription(), lastUpdatedByUser); + String description = getOverriddenValue(existingSecret.getDescription(), secretPayload.getdescription()); + setSecretMetadataProperties(decodedSecret, description, lastUpdatedByUser); } credentialsService.setCredentials(secretName, decodedSecret);