feat(auth): integrate authentication with installation lifecycle

This commit is contained in:
2026-08-17 23:33:51 +02:00
parent 0d0c15b4b8
commit e8b9995ed0
21 changed files with 672 additions and 234 deletions
+7 -1
View File
@@ -4,9 +4,15 @@ const STARTUP_CAUSES = new Set([
"workspace_registry_invalid",
]);
const EXACT_CAUSES = new Map([
["authentication configuration is invalid", "auth_config_invalid"],
["authentication session state is invalid", "auth_session_store_invalid"],
["workspace registry configuration is invalid", "workspace_registry_invalid"],
]);
/** Return one bounded machine cause; never include the original error text or stack. */
export function formatStartupFailure(error: unknown): string {
const message = error instanceof Error ? error.message : "";
const cause = STARTUP_CAUSES.has(message) ? message : "startup_unknown";
const cause = STARTUP_CAUSES.has(message) ? message : EXACT_CAUSES.get(message) ?? "startup_unknown";
return `backend startup failed: ${cause}`;
}