Memory Auth Store¶
Import: import system.webapi.auth;
See the Web APIs guide for runnable examples, lifecycle, and error behavior.
MemoryAuthStore¶
Process-local storage for tests and single-process examples. Methods perform no suspension during mutations.
constructor¶
Creates a MemoryAuthStore with default settings.
create¶
Stores a new refresh session; returns an error if its token hash already exists.
find¶
Finds an unexpired session at epoch-second time now; rejects revoked or missing sessions.
rotate¶
Consumes a refresh session and stores its replacement. Replay revokes the family; invalid replacements return an error.
public async unique fun rotate(
hash: string,
replacement: AuthSession,
now: long
): Result<AuthSession, AuthError>
revoke¶
Revokes all refresh sessions in family.
active¶
Returns whether family has an unexpired, unconsumed session at epoch-second time now.
put_transaction¶
Stores a login transaction under state; duplicate state returns an error.
public async unique fun put_transaction(
state: string,
transaction: OidcTransaction
): Result<Unit, AuthError>
take_transaction¶
Removes and returns the login transaction. Missing or expired state returns an error.