feat: implement Redis session management and user authentication flow
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import type { UserRecord } from './userRepository.js';
|
||||
|
||||
export interface GatewaySessionInfo {
|
||||
sessionToken: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
issuedAt: string;
|
||||
}
|
||||
|
||||
export interface GameSessionInfo {
|
||||
profile: string;
|
||||
gameToken: string;
|
||||
sessionToken: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
issuedAt: string;
|
||||
}
|
||||
|
||||
export interface GatewaySessionConfig {
|
||||
sessionTtlSeconds: number;
|
||||
gameSessionTtlSeconds: number;
|
||||
}
|
||||
|
||||
export interface SessionRevocationOptions {
|
||||
revokeGames?: boolean;
|
||||
}
|
||||
|
||||
export interface GatewaySessionService {
|
||||
createSession(user: UserRecord): Promise<GatewaySessionInfo>;
|
||||
getSession(sessionToken: string): Promise<GatewaySessionInfo | null>;
|
||||
revokeSession(sessionToken: string, options?: SessionRevocationOptions): Promise<void>;
|
||||
createGameSession(sessionToken: string, profile: string): Promise<GameSessionInfo | null>;
|
||||
getGameSession(profile: string, gameToken: string): Promise<GameSessionInfo | null>;
|
||||
}
|
||||
Reference in New Issue
Block a user