Files
mtusi2026lab7/scripts/validate-gateways.ts

45 lines
1.0 KiB
TypeScript

import { writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { root, compose, safeFailure } from "./runtime";
try {
const results = [];
for (const service of [
"lb",
"api1-gateway",
"api2-gateway",
"worker-gateway",
"broker-gateway",
"s3-gateway",
"collector-gateway",
"openobserve-gateway",
"grafana-gateway",
]) {
const result = await compose([
"run",
"--rm",
"--no-deps",
service,
"haproxy",
"-c",
"-f",
"/usr/local/etc/haproxy/haproxy.cfg",
]);
results.push({ service, exit: result.code });
}
await writeFile(
resolve(root, "evidence/security/gateway-parser.json"),
JSON.stringify(
{
native: "HAProxy3.2.26 cached pinned digest",
scope: "configuration parser only, not upstream/runtime acceptance",
results,
},
null,
2,
) + "\n",
);
console.log("PASS_NATIVE_PARSER_ALL_CURRENT_GATEWAYS");
} catch (error) {
safeFailure(error);
}