From 8da76739ecca7d0ba2ad7e30cb9e0267e07dd0fd Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <adhisimon@gmail.com>
Date: Mon, 14 Nov 2022 15:07:57 +0700
Subject: [PATCH] config.partner.callback.debug_apikey

---
 config.sample.json             | 3 ++-
 lib/callback/apikey-checker.js | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/config.sample.json b/config.sample.json
index d2e1c03..897cb0d 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -13,7 +13,8 @@
         "PLEASE_CHANGE_ME"
       ],
       "trust_proxy": ["loopback"],
-      "dump_request": true
+      "dump_request": true,
+      "debug_apikey": false
     }
   },
   "control_panel": {
diff --git a/lib/callback/apikey-checker.js b/lib/callback/apikey-checker.js
index 2398724..4af8e7b 100644
--- a/lib/callback/apikey-checker.js
+++ b/lib/callback/apikey-checker.js
@@ -3,7 +3,8 @@ const MODULE_NAME = 'CALLBACK.APIKEY-CHECKER';
 const config = require('komodo-sdk/config');
 const logger = require('tektrans-logger');
 
-const { DEBUG_CALLBACK_APIKEY } = process.env;
+const DEBUG_CALLBACK_APIKEY = process.env.DEBUG_CALLBACK_APIKEY
+    || (config.partner && config.partner.callback && config.partner.callback.debug_apikey);
 
 const sendInvalidApikeyResponse = (xid, res) => {
     res.status(403).json({
-- 
1.9.0