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

Function authenticate

apps/host-selfhost/src/mcp/auth.ts:277–289  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

275 * Authenticated or Unauthorized.
276 */
277 const authenticate = (request: Request): Effect.Effect<AuthOutcome> =>
278 (hasBearer(request)
279 ? authenticateOAuthBearer(request).pipe(
280 Effect.flatMap((principal) =>
281 principal ? Effect.succeed(principal) : authenticateSession(request),
282 ),
283 )
284 : authenticateSession(request)
285 ).pipe(
286 Effect.map((principal) =>
287 principal ? authenticated(principal) : unauthorized(challengeFor(request)),
288 ),
289 );
290
291 return {
292 discoveryRoutes,

Callers

nothing calls this directly

Calls 6

hasBearerFunction · 0.85
authenticateOAuthBearerFunction · 0.85
authenticateSessionFunction · 0.85
authenticatedFunction · 0.85
challengeForFunction · 0.70
unauthorizedFunction · 0.50

Tested by

no test coverage detected