INNER CODE UNIT · JavaScript

hard

JoasASantos/NeuroSploit · web/server.js:204

  const hard = (Array.isArray(scope.hard) ? scope.hard : String(scope.hard || '').split(/[\n,;]+/)).map((x) => String(x).trim()).filter(Boolean);
  if (!hard.length) return undefined; // no boundary set — nothing to enforce beyond flags
  const dir = path.join(os.tmpdir(), 'neurosploit-web');
  await fsp.mkdir(dir, { recursive: true });
  const file = path.join(dir, `${jobId}.scope.yaml`);
  await fsp.writeFile(file, buildScopeYaml(scope));
  return file;
}

async function materializeCreds(body, jobId) {
  if (body.creds) return body.creds; // explicit file path on disk wins
  if (!body.auth && !(body.roles || []).length) return undefined;
  const dir = path.join(os.tmpdir(), 'neurosploit-web');
  await fsp.mkdir(dir, { recursive: true });
  const file = path.join(dir, `${jobId}.creds.yaml`);
  await fsp.writeFile(file, buildCredsYaml(body));
  return file;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…