From 994a83bb9598facd9b9a4575f42b5a3c4a212f8f Mon Sep 17 00:00:00 2001 From: Sriharsha Chintalapani Date: Fri, 27 May 2022 18:23:52 -0700 Subject: [PATCH] Webhook post fails due to empty secretKey (#5203) --- .../java/org/openmetadata/catalog/jdbi3/WebhookRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/WebhookRepository.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/WebhookRepository.java index 889f5c72464..6a17311dac0 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/WebhookRepository.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/WebhookRepository.java @@ -210,7 +210,7 @@ public class WebhookRepository extends EntityRepository { try { String json = JsonUtils.pojoToJson(list); Response response; - if (webhook.getSecretKey() != null) { + if (webhook.getSecretKey() != null && !webhook.getSecretKey().isEmpty()) { String hmac = "sha256=" + CommonUtil.calculateHMAC(webhook.getSecretKey(), json); response = getTarget().header(RestUtil.SIGNATURE_HEADER, hmac).post(javax.ws.rs.client.Entity.json(json)); } else {