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

Function toOutcome

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

Source from the content-addressed store, hash-verified

176 });
177
178 const toOutcome = (request: Request, result: McpAuthResult): Effect.Effect<AuthOutcome> => {
179 if (Predicate.isTagged(result, "Authorized")) {
180 return finishAuthorized(request, result.token);
181 }
182 return annotateMcpRequest(request, { token: null, parseBody: false }).pipe(
183 Effect.as(
184 unauthorized(
185 bearerChallengeFor(
186 result,
187 mcpOrganizationFromRequest(request),
188 toolkitSlugFromRequest(request),
189 ),
190 ),
191 ),
192 );
193 };
194
195 /**
196 * 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