MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveOrgSlug

Function resolveOrgSlug

apps/host-selfhost/src/config.ts:182–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180// operator-set value must fit the shared grammar and avoid reserved root
181// segments (api, mcp, login, …) — a colliding slug would shadow real routes.
182const resolveOrgSlug = (): string => {
183 const slug = process.env.EXECUTOR_ORG_SLUG;
184 if (!slug) return "default";
185 if (!isValidOrgSlug(slug) && slug !== "default") {
186 // 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
187 throw new Error(
188 `EXECUTOR_ORG_SLUG ${JSON.stringify(slug)} is not usable as a URL slug (2-48 chars of [a-z0-9-], not a reserved path segment like "api" or "login")`,
189 );
190 }
191 return slug;
192};

Callers 1

loadConfigFunction · 0.70

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected