Skip to Content
API referenceSIWX ServerSrcClassesMemorySiwxSessionStore

API Reference — @tuwaio/siwx (CAIP-122 Authentication Layer)


MemorySiwxSessionStore

Defined in: packages/siwx-server/src/server.ts:331 

In-memory implementation of SiwxSessionStore. STRICTLY for local development, prototyping, and unit testing. Fails closed in production environments.

Implements

Constructors

Constructor

new MemorySiwxSessionStore(options?): MemorySiwxSessionStore

Defined in: packages/siwx-server/src/server.ts:334 

Parameters

options?
allowInProduction?

boolean

Returns

MemorySiwxSessionStore

Methods

bindSubject()

bindSubject(id, subjectId): Promise<boolean>

Defined in: packages/siwx-server/src/server.ts:369 

Atomically binds a user/subject identifier to the session.

Parameters

id

string

The session ID.

subjectId

string

The user or subject ID.

Returns

Promise<boolean>

True if binding succeeded, false if session not found.

Implementation of

SiwxSessionStore.bindSubject


create()

create(input): Promise<SiwxSessionRecord>

Defined in: packages/siwx-server/src/server.ts:345 

Creates and stores a new session record.

Parameters

input
session

SiwxSession

The verified session data.

ttlSeconds

number

Time-to-live in seconds.

Returns

Promise<SiwxSessionRecord>

The created session record with unique ID.

Implementation of

SiwxSessionStore.create


get()

get(id): Promise<SiwxSessionRecord | null>

Defined in: packages/siwx-server/src/server.ts:359 

Retrieves a session record by its opaque ID.

Parameters

id

string

The session ID.

Returns

Promise<SiwxSessionRecord | null>

The session record, or null if not found or expired.

Implementation of

SiwxSessionStore.get


revoke()

revoke(id): Promise<void>

Defined in: packages/siwx-server/src/server.ts:376 

Revokes and removes a session record.

Parameters

id

string

The session ID.

Returns

Promise<void>

Implementation of

SiwxSessionStore.revoke

Last updated on