From 90bd82f49abbcc27c7d7733c627ea3a8e43dc945 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Thu, 4 Jun 2026 05:18:34 +0000 Subject: [PATCH] debug(node-agent): log auth reject token lengths --- services/node-agent/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/node-agent/index.js b/services/node-agent/index.js index 282c632..c4759bf 100644 --- a/services/node-agent/index.js +++ b/services/node-agent/index.js @@ -961,7 +961,12 @@ function checkAgentAuth(req) { const m = /^Bearer\s+(.+)$/i.exec(hdr); if (!m) return false; const token = m[1]; - return _bearerEq(token, NODE_TOKEN) || _bearerEq(token, CLUSTER_READ_TOKEN); + const okNode = _bearerEq(token, NODE_TOKEN); + const okShared = _bearerEq(token, CLUSTER_READ_TOKEN); + if (!okNode && !okShared) { + console.warn(`[auth] reject: tok.len=${token.length} NODE_TOKEN.len=${NODE_TOKEN.length} CLUSTER_READ_TOKEN.len=${CLUSTER_READ_TOKEN.length}`); + } + return okNode || okShared; } // ── Driver/SDK install ────────────────────────────────────────────────────