feat: implement notification controller for handling incoming notifications with signature verification and add corresponding unit tests.

This commit is contained in:
2026-02-25 16:11:23 +07:00
parent 8fc779e55a
commit d6aa24b82e
2 changed files with 2 additions and 19 deletions

View File

@@ -5,12 +5,8 @@ class NotificationController {
static async handle(req, res) {
const payload = req.body;
try {
const callbackToken = req.headers['x-callback-token'];
if (callbackToken !== process.env.ROUTER_CALLBACK_TOKEN) {
return responseHelper.error(res, "Unauthorized token router gateway", 401);
}
try {
const isValid = notificationService.verifySignature(payload);
if (!isValid) {
return responseHelper.error(res, "Invalid Signature Key", 403);