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

Function toOutcome

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

Source from the content-addressed store, hash-verified

229 });
230
231 const toOutcome = (request: Request, result: McpAuthResult): Effect.Effect<AuthOutcome> => {
232 if (Predicate.isTagged(result, "Authorized")) {
233 return finishAuthorized(request, result.token);
234 }
235 return annotateMcpRequest(request, {
236 token: null,
237 parseBody: false,
238 }).pipe(
239 Effect.as(
240 unauthorized(
241 bearerChallengeFor(
242 result,
243 mcpOrganizationFromRequest(request),
244 toolkitSlugFromRequest(request),
245 ),
246 ),
247 ),
248 );
249 };
250
251 /**
252 * 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