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
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
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