mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 02:15:44 +00:00
verify:browser:request records a write session against a fixture item API that refuses writes without its CSRF cookie header and stored bearer token. It checks that every request lands in its own step, that the page values authenticated each write and appear in no record, header or body, that an unexpected status fails the step and cancels the rest, and that environment-build serves the recorded create, update and delete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
863 B
JavaScript
19 lines
863 B
JavaScript
#!/usr/bin/env node
|
|
import { access } from "node:fs/promises";
|
|
import { verifyBrowserRequestSteps } from "./lib/browser-request-e2e.mjs";
|
|
import { createVerifierRun, completeVerifierRun } from "./lib/verifier-run.mjs";
|
|
import { requireOrdinaryWindowsVerifierCaller } from "./lib/windows-ordinary-user-verifier.mjs";
|
|
|
|
const executable = process.env.REA_BROWSER_EXECUTABLE;
|
|
if (executable === undefined || executable === "")
|
|
throw new Error(
|
|
"verify:browser:request requires REA_BROWSER_EXECUTABLE pointing to an installed Chrome-family browser",
|
|
);
|
|
await requireOrdinaryWindowsVerifierCaller();
|
|
await access(executable);
|
|
const run = createVerifierRun();
|
|
const proof = await verifyBrowserRequestSteps(executable, process.argv[2]);
|
|
process.stdout.write(
|
|
`${JSON.stringify({ ...proof, verifier_run: await completeVerifierRun(run), verified: true })}\n`,
|
|
);
|