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

Function toOutcome

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

Source from the content-addressed store, hash-verified

240 });
241
242 const toOutcome = (request: Request, result: McpAuthResult): Effect.Effect<AuthOutcome> => {
243 if (Predicate.isTagged(result, "Authorized")) {
244 return finishAuthorized(request, result.token);
245 }
246 return annotateMcpRequest(request, {
247 token: null,
248 parseBody: false,
249 }).pipe(
250 Effect.as(
251 unauthorized(
252 bearerChallengeFor(
253 result,
254 mcpOrganizationFromRequest(request),
255 toolkitSlugFromRequest(request),
256 ),
257 ),
258 ),
259 );
260 };
261
262 /**
263 * 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