debug(node-agent): log auth reject token lengths

This commit is contained in:
Zac Gaetano 2026-06-04 05:18:34 +00:00
parent 70c873ae95
commit 90bd82f49a

View file

@ -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 ────────────────────────────────────────────────────