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

Function toOutcome

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

Source from the content-addressed store, hash-verified

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