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

Function orgIdOf

e2e/cloud/mcp-protocol.test.ts:55–61  ·  view source on GitHub ↗
(bearer: string)

Source from the content-addressed store, hash-verified

53
54/** The org the bearer is scoped to, read from the JWT's public claims. */
55const orgIdOf = (bearer: string): string => {
56 const claims = JSON.parse(Buffer.from(bearer.split(".")[1] ?? "", "base64url").toString()) as {
57 readonly org_id?: string;
58 };
59 if (!claims.org_id) throw new Error("orgIdOf: bearer carries no org_id claim");
60 return claims.org_id;
61};
62
63const mcpPost = (
64 url: string | URL,

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected