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 {
+1
View File
@@ -2,6 +2,7 @@ services:
core:
environment:
AUTH_MODE: none
NODE_ENV: development
THT_WORKSPACE_INSTALLATION_ID: local
ports:
- "127.0.0.1:${THOTH_CORE_HTTP_PORT:-8787}:8787"
+1
View File
@@ -17,6 +17,7 @@ services:
THT_BIN: /opt/venv/bin/tht
PI_BIN: pi
AUTH_MODE: none
NODE_ENV: development
THT_SESSION_STORAGE: local
THT_HOME: /data/local-home
THT_DATA_ROOT: /data