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

Function toOutcome

apps/cloud/src/mcp/auth-provider.ts:230–248  ·  view source on GitHub ↗
(request: Request, result: McpAuthResult)

Source from the content-addressed store, hash-verified

228 });
229
230 const toOutcome = (request: Request, result: McpAuthResult): Effect.Effect<AuthOutcome> => {
231 if (Predicate.isTagged(result, "Authorized")) {
232 return finishAuthorized(request, result.token);
233 }
234 return annotateMcpRequest(request, {
235 token: null,
236 parseBody: false,
237 }).pipe(
238 Effect.as(
239 unauthorized(
240 bearerChallengeFor(
241 result,
242 mcpOrganizationFromRequest(request),
243 toolkitSlugFromRequest(request),
244 ),
245 ),
246 ),
247 );
248 };
249
250 /**
251 * Never fails: a transient JWKS-infra failure (the McpJwtVerificationError

Callers 1

authenticateFunction · 0.85

Calls 6

annotateMcpRequestFunction · 0.90
bearerChallengeForFunction · 0.90
toolkitSlugFromRequestFunction · 0.90
finishAuthorizedFunction · 0.85
unauthorizedFunction · 0.70

Tested by

no test coverage detected