fix(auth): tighten bridge claim protocol

This commit is contained in:
2026-08-16 22:44:44 +02:00
parent 7d9ca13f1d
commit 8477a69a29
7 changed files with 333 additions and 40 deletions
@@ -0,0 +1,21 @@
import { appendFileSync, closeSync, writeFileSync } from "node:fs";
const [, , mode, marker] = process.argv;
writeFileSync(marker, `started:${process.pid}\n`);
process.on("exit", () => appendFileSync(marker, "exited\n"));
process.on("SIGTERM", () => {
appendFileSync(marker, "terminated\n");
process.exit(0);
});
if (mode === "stdin") {
closeSync(0);
appendFileSync(marker, "stdin-closed\n");
} else if (mode === "stdout") {
process.stdout.write(Buffer.alloc(64 * 1024 + 1));
} else if (mode === "stderr") {
process.stderr.write(Buffer.alloc(64 * 1024 + 1));
}
setInterval(() => {}, 1_000);