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

Function authenticate

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

Source from the content-addressed store, hash-verified

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