Merge branch 't3/implement-auth-deploy'
Integrate auth, config, watcher and terminal wiring in buildApp: auth guards every API route by default, notebook watcher events feed the /api/events hub, the terminal runs in the configured workspace, and SHELLBOOK_DATA_DIR is the single data directory variable. The systemd unit uses KillMode=process so tmux sessions survive service restarts.
This commit is contained in:
@@ -36,7 +36,7 @@ describe("terminal validation", () => {
|
||||
|
||||
describe("terminal plugin", () => {
|
||||
it("is registered by buildApp and rejects invalid sessions", async () => {
|
||||
const app = await buildApp();
|
||||
const app = await buildApp({ auth: false });
|
||||
try {
|
||||
expect(app.hasRoute({ method: "GET", url: "/api/terminal" })).toBe(true);
|
||||
expect((await app.inject("/api/terminal?session=BAD")).statusCode).toBe(400);
|
||||
@@ -65,7 +65,7 @@ describe("terminal plugin", () => {
|
||||
// injectWS uses in-memory Duplexify streams whose close handshake does not
|
||||
// finish like a TCP socket. Terminate the server peer to model a lost tab.
|
||||
const peers = [...app.websocketServer.clients];
|
||||
peers[0].terminate();
|
||||
peers[0]!.terminate();
|
||||
await vi.waitFor(() => expect(first.pty.kill).toHaveBeenCalledTimes(1));
|
||||
expect(second.pty.kill).not.toHaveBeenCalled();
|
||||
expect(first.dataDispose).toHaveBeenCalledOnce();
|
||||
|
||||
Reference in New Issue
Block a user