Skip to content

nooschain v0.1.0


nooschain / auth/api-auth / resolveApiActor

Function: resolveApiActor()

resolveApiActor(db, headers, options?): Promise<ApiAuthResult>

Defined in: auth/api-auth.ts:37

Resolves an HTTP request into a NOOSChain API actor.

Resolution order is bearer token first, then the development public-key header when explicitly allowed outside production, then anonymous. In production mode a missing/invalid bearer token is rejected by the session store so protected routes fail closed instead of silently becoming anonymous.

Parameters

db

ChainDatabase

headers

ApiAuthHeaders

options?

allowDevPublicKeyHeader?

boolean

authSessionStore?

AuthSessionStore

productionMode?

boolean

Returns

Promise<ApiAuthResult>

Audience-first NOOSChain documentation.