From 95ce7f915078bad8dc188d686fcf38e1f553d116 Mon Sep 17 00:00:00 2001 From: eastargh Date: Thu, 27 Aug 2026 13:36:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B7=A8=EC=95=BD=EC=A0=90=20=EC=A0=90?= =?UTF-8?q?=EA=B2=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WebhookSendController.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/eactive/eai/rms/ext/djb/webhook/controller/WebhookSendController.java b/src/main/java/com/eactive/eai/rms/ext/djb/webhook/controller/WebhookSendController.java index ec74eae..f764366 100644 --- a/src/main/java/com/eactive/eai/rms/ext/djb/webhook/controller/WebhookSendController.java +++ b/src/main/java/com/eactive/eai/rms/ext/djb/webhook/controller/WebhookSendController.java @@ -60,7 +60,7 @@ public class WebhookSendController { * X-Webhook-Signature : sha256={hmac값} * X-Webhook-Event : ORDER_CREATED * X-Webhook-Timestamp : 1712345678901 - */ + @PostMapping("/receive") public ResponseEntity> receiveWebhook( @RequestHeader(value = "x-webhook-signature", required = false) String signature, @@ -80,12 +80,14 @@ public class WebhookSendController { } // 2. 서명 검증 - boolean isValid = webhookReceiveService.verifySignature(rawPayload, signature, ""); - if (!isValid) { - log.warn("[Webhook] 수신 거부 - 서명 불일치 / eventType: {}", eventType); - return ResponseEntity - .status(HttpStatus.UNAUTHORIZED) - .body(errorResponse("서명 검증에 실패하였습니다.")); + Boolean isValid = webhookReceiveService.verifySignature(rawPayload, signature, ""); + if (isValid != null) { + if (!isValid) { + log.warn("[Webhook] 수신 거부 - 서명 불일치 / eventType: {}", eventType); + return ResponseEntity + .status(HttpStatus.UNAUTHORIZED) + .body(errorResponse("서명 검증에 실패하였습니다.")); + } } // 3. 타임스탬프 유효성 검증 (5분 이내 요청만 허용) @@ -114,6 +116,7 @@ public class WebhookSendController { return ResponseEntity.ok(response); } + */ /* ------------------------------------------------------------------ */ /* 공통 */