fix(auth): declare local development environment
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user