diff --git a/services/node-agent/index.js b/services/node-agent/index.js index ee8f0ba..98ca491 100644 --- a/services/node-agent/index.js +++ b/services/node-agent/index.js @@ -1,6 +1,7 @@ import http from 'http'; import os from 'os'; import fs from 'fs'; +import crypto from 'crypto'; import { spawn } from 'child_process'; const MAM_API_URL = (process.env.MAM_API_URL || 'http://localhost:3000').replace(/\/$/, ''); @@ -961,12 +962,7 @@ function checkAgentAuth(req) { const m = /^Bearer\s+(.+)$/i.exec(hdr); if (!m) return false; const token = m[1]; - const okNode = _bearerEq(token, NODE_TOKEN); - const okShared = _bearerEq(token, CLUSTER_READ_TOKEN); - if (!okNode && !okShared) { - 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; + return _bearerEq(token, NODE_TOKEN) || _bearerEq(token, CLUSTER_READ_TOKEN); } // ── Driver/SDK install ────────────────────────────────────────────────────