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

Function authenticate

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

Source from the content-addressed store, hash-verified

249 * Authenticated or Unauthorized.
250 */
251 const authenticate = (request: Request): Effect.Effect<AuthOutcome> =>
252 (hasBearer(request)
253 ? authenticateOAuthBearer(request).pipe(
254 Effect.flatMap((principal) =>
255 principal ? Effect.succeed(principal) : authenticateSession(request),
256 ),
257 )
258 : authenticateSession(request)
259 ).pipe(
260 Effect.map((principal) =>
261 principal ? authenticated(principal) : unauthorized(challengeFor(request)),
262 ),
263 );
264
265 return {
266 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