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

Function makeMcpOrganizationAuthServices

apps/cloud/src/mcp/auth.ts:209–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207// MemberDirectory + WorkOsMirror layer per call gives each request its own
208// request-scoped socket. `CoreSharedServices` (WorkOS, no per-request socket) stays shared.
209const makeMcpOrganizationAuthServices = () => {
210 const dbLive = makeDbLayer();
211 const userStoreLive = makeUserStoreLayer().pipe(Layer.provide(dbLive));
212 const memberDirectoryLive = makeMemberDirectoryLayer().pipe(Layer.provide(dbLive));
213 const workOsMirrorLive = makeWorkOsMirrorLayer().pipe(Layer.provide(dbLive));
214 return Layer.mergeAll(
215 dbLive,
216 userStoreLive,
217 memberDirectoryLive,
218 workOsMirrorLive,
219 CoreSharedServices,
220 );
221};
222
223// A URL slug resolves through the mirror to its org id before the membership
224// check; an unknown slug authorizes nothing. Ids pass straight through —

Callers 1

auth.tsFile · 0.85

Calls 4

makeDbLayerFunction · 0.90
makeUserStoreLayerFunction · 0.90
makeMemberDirectoryLayerFunction · 0.90
makeWorkOsMirrorLayerFunction · 0.90

Tested by

no test coverage detected