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

Function orgIdOf

e2e/cloud/mcp-execution-limits.test.ts:35–41  ·  view source on GitHub ↗
(bearer: string)

Source from the content-addressed store, hash-verified

33/** The org the bearer is scoped to — the Autumn customer id the guards decide
34 * against — read from the JWT's public claims. */
35const orgIdOf = (bearer: string): string => {
36 const claims = JSON.parse(Buffer.from(bearer.split(".")[1] ?? "", "base64url").toString()) as {
37 readonly org_id?: string;
38 };
39 if (!claims.org_id) throw new Error("orgIdOf: bearer carries no org_id claim");
40 return claims.org_id;
41};
42
43// The e2e worker is booted with a small EXECUTION_RATE_LIMIT_PER_HOUR so the
44// backstop is reachable with real executions (cloud.boot.ts). The prod cap of

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected