feat: add TTL to GameSessionStore, replay protection and session cleanup to evaluateAnswer

This commit is contained in:
lila 2026-04-28 14:03:15 +02:00
parent 54705943fa
commit fdeb769640
6 changed files with 218 additions and 7 deletions

View file

@ -1,7 +1,11 @@
export type GameSessionData = { answers: Map<string, number> };
export interface GameSessionStore {
create(sessionId: string, data: GameSessionData): Promise<void>;
create(
sessionId: string,
data: GameSessionData,
ttlMs: number,
): Promise<void>;
get(sessionId: string): Promise<GameSessionData | null>;
delete(sessionId: string): Promise<void>;
}