Skip to content

nooschain v0.1.0


nooschain / auth/session-tokens / AuthSessionStore

Interface: AuthSessionStore

Defined in: auth/session-tokens.ts:61

Session-store contract used by API auth resolution.

The default implementation is in-memory for development/testing, but route code depends on this interface so a persistent or distributed store can be substituted without changing API handlers.

Methods

createAuthChallenge()

createAuthChallenge(publicKey): AuthChallenge

Defined in: auth/session-tokens.ts:63

Creates and stores a short-lived, one-use challenge for a public key.

Parameters

publicKey

string

Returns

AuthChallenge


loginWithChallenge()

loginWithChallenge(args): AuthSession

Defined in: auth/session-tokens.ts:65

Verifies a signed challenge and returns a new bearer session.

Parameters

args
challengeId

string

challengeSignature

string

publicKey

string

Returns

AuthSession


requireSessionPublicKey()

requireSessionPublicKey(authorizationHeader): string

Defined in: auth/session-tokens.ts:73

Returns the session public key or throws AuthError when auth is not valid.

Parameters

authorizationHeader

string | undefined

Returns

string


resolveSessionPublicKey()

resolveSessionPublicKey(authorizationHeader): string | undefined

Defined in: auth/session-tokens.ts:71

Returns the session public key, or undefined when the header is absent/invalid/expired.

Parameters

authorizationHeader

string | undefined

Returns

string | undefined

Audience-first NOOSChain documentation.