MCPcopy Create free account
hub / github.com/Noumena-Network/code / resolveFastModeFetchAuth

Function resolveFastModeFetchAuth

src/utils/fastModeSession.ts:31–52  ·  view source on GitHub ↗
(
  session: FastModeSessionInput,
)

Source from the content-addressed store, hash-verified

29}
30
31export function resolveFastModeFetchAuth(
32 session: FastModeSessionInput,
33): FastModeFetchAuth {
34 if (
35 session?.headersKind === 'bearer' &&
36 session.hasUsableToken &&
37 Boolean(session.accessToken) &&
38 session.scopes.includes('user:profile')
39 ) {
40 return { accessToken: session.accessToken }
41 }
42
43 if (
44 session?.headersKind === 'api_key' &&
45 session.hasUsableApiKey &&
46 Boolean(session.apiKey)
47 ) {
48 return { apiKey: session.apiKey }
49 }
50
51 return null
52}

Callers 4

prefetchFastModeStatusFunction · 0.85
fetchWithCurrentAuthFunction · 0.85
doFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected