Security hardening: authentication, input validation, OWASP compliance, architecture improvements, and CSP fixes for browser mode (#942)

This commit is contained in:
Copilot
2025-12-22 16:52:42 +01:00
committed by GitHub
parent a7136bd572
commit 6c041cba02
50 changed files with 1943 additions and 734 deletions

View File

@@ -1,13 +1,21 @@
import { Socket } from 'socket.io-client'
import { CallbackStore } from './CallbackStore'
import { EventBusInterface } from './EventBusInterface'
import { Event } from '../Events'
// Generic socket interface that socket.io-client's Socket implements
// This avoids direct dependency on socket.io-client package
export interface SocketLike {
on(event: string, callback: (...args: any[]) => void): any
off(event: string, callback: (...args: any[]) => void): any
removeAllListeners(event: string): any
emit(event: string, ...args: any[]): any
}
export class SocketIOClientEventBus implements EventBusInterface {
private socket: Socket
private socket: SocketLike
private callbacks: Array<CallbackStore> = []
constructor(socket: Socket) {
constructor(socket: SocketLike) {
this.socket = socket
}