fix(auth): declare local development environment

This commit is contained in:
2026-08-16 17:36:42 +02:00
parent e54ce15426
commit 23ac75ce1d
3 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -1,5 +1,5 @@
import { expect, test } from "vitest";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { stringify } from "yaml";
@@ -88,6 +88,12 @@ test("loadConfig allows none and mock only outside production when auth.yaml is
.toThrow("production requires auth.yaml or AUTH_MODE=upstream");
});
test("local Compose profiles explicitly select the development auth environment", () => {
for (const profile of ["../../deploy/compose.local.yaml", "../../docker-compose.dev.yml"]) {
expect(readFileSync(new URL(profile, import.meta.url), "utf8")).toMatch(/NODE_ENV:\s*development/);
}
});
test("loadConfig makes an existing auth.yaml authoritative and rejects AUTH_MODE split-brain", () => {
const { directory, file } = authFile(oidcAuthConfig());
try {