debug(node-agent): log token prefix/suffix on auth reject

This commit is contained in:
Zac Gaetano 2026-06-04 05:20:13 +00:00
parent 90bd82f49a
commit 4ad145f00a

View file

@ -964,7 +964,7 @@ function checkAgentAuth(req) {
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}`);
console.warn(`[auth] reject: tok=${token.slice(0,6)}..${token.slice(-6)} CRT=${CLUSTER_READ_TOKEN.slice(0,6)}..${CLUSTER_READ_TOKEN.slice(-6)} match=${token===CLUSTER_READ_TOKEN}`);
}
return okNode || okShared;
}