(value: string | undefined)
| 83 | // segments — a colliding slug would shadow real routes (notably /api, /mcp, |
| 84 | // and Cloudflare's /cdn-cgi). |
| 85 | const resolveOrgSlug = (value: string | undefined): string => { |
| 86 | if (!value) return "default"; |
| 87 | if (!isValidOrgSlug(value) && value !== "default") { |
| 88 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: a colliding org slug would shadow app routes; refuse to boot |
| 89 | throw new Error( |
| 90 | `SELF_HOSTED_ORG_SLUG ${JSON.stringify(value)} is not usable as a URL slug (2-48 chars of [a-z0-9-], not a reserved path segment like "api" or "mcp")`, |
| 91 | ); |
| 92 | } |
| 93 | return value; |
| 94 | }; |
| 95 | |
| 96 | export const loadConfig = (env: CloudflareEnv): CloudflareConfig => { |
| 97 | const secretKey = env.EXECUTOR_SECRET_KEY?.trim(); |
no test coverage detected