feat: compose executable frontend runtime
This commit is contained in:
@@ -10,7 +10,7 @@ export const runtimeConfigSchema = z
|
||||
MAX_RETRY_ATTEMPTS: z.int().min(0).max(2).default(2),
|
||||
TELEMETRY_ENABLED: z.boolean(),
|
||||
TELEMETRY_ENDPOINT: z.url().optional(),
|
||||
AUTH_MODE: z.literal("external"),
|
||||
AUTH_MODE: z.enum(["external", "demo"]),
|
||||
CONFIG_SCHEMA_VERSION: version,
|
||||
API_CONTRACT_VERSION: version,
|
||||
RELEASE_MANIFEST_URL: z.string().min(1).default("/release-manifest.json"),
|
||||
@@ -28,6 +28,13 @@ export const runtimeConfigSchema = z
|
||||
}
|
||||
|
||||
const local = config.APP_ENV === "local" || config.APP_ENV === "development";
|
||||
if (!local && config.AUTH_MODE === "demo") {
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
path: ["AUTH_MODE"],
|
||||
message: "demo authentication is limited to local environments",
|
||||
});
|
||||
}
|
||||
const endpointEntries =
|
||||
/** @type {Array<[string, string | undefined]>} */ ([
|
||||
["API_BASE_URL", config.API_BASE_URL],
|
||||
|
||||
Reference in New Issue
Block a user