MCPcopy Create free account
hub / github.com/EvoMap/evolver / buildNodeScopedHubHeadersSafe

Function buildNodeScopedHubHeadersSafe

src/gep/cliContracts.js:978–996  ·  view source on GitHub ↗
(a2a, deps)

Source from the content-addressed store, hash-verified

976}
977
978function buildNodeScopedHubHeadersSafe(a2a, deps) {
979 if (!deps || deps.nodeSecret === undefined) {
980 try {
981 if (typeof a2a.buildNodeScopedHubHeaders === 'function') {
982 const headers = a2a.buildNodeScopedHubHeaders() || {};
983 if (hasAuthorizationHeader(headers)) return headers;
984 }
985 } catch (_) {}
986 }
987 const nodeSecret = getHubNodeSecret(deps || {});
988 if (!nodeSecret) return {};
989 const headers = {
990 'Content-Type': 'application/json',
991 Authorization: 'Bearer ' + nodeSecret,
992 };
993 const secretVersion = getHubNodeSecretVersionSafe(a2a);
994 if (secretVersion) headers['X-EvoMap-Node-Secret-Version'] = String(secretVersion);
995 return headers;
996}
997
998function getHubNodeSecretVersionSafe(a2a) {
999 try {

Callers 1

buildEnvelopeHeadersFunction · 0.85

Calls 3

hasAuthorizationHeaderFunction · 0.85
getHubNodeSecretFunction · 0.85

Tested by

no test coverage detected