UNPKG

@appsensorlike/appsensorlike

Version:

A port of OWASP AppSensor reference implementation

47 lines (46 loc) 1.5 kB
/** * The attack analysis engine is an implementation of the Observer pattern. * * In this case the analysis engines watches the {@link AttackStore} interface. * * AnalysisEngine implementations are the components of AppSensor that * constitute the "brain" of the system. * * In contrast to the ORIGINAL code here methods are asynchronous returning Promise<T>. */ class AttackAnalysisEngine { async onAdd(attack) { await this.analyze(attack); } } /** * The event analysis engine is an implementation of the Observer pattern. * * In this case the analysis engines watches the {@link EventStore} interface. * * AnalysisEngine implementations are the components of AppSensor that * constitute the "brain" of the system. * * In contrast to the ORIGINAL code here methods are asynchronous returning Promise<T>. */ class EventAnalysisEngine { async onAdd(event) { await this.analyze(event); } } /** * The response analysis engine is an implementation of the Observer pattern. * * In this case the analysis engines watches the {@link ResponseStore} interface. * * AnalysisEngine implementations are the components of AppSensor that * constitute the "brain" of the system. * * In contrast to the ORIGINAL code here methods are asynchronous returning Promise<T>. */ class ResponseAnalysisEngine { async onAdd(response) { await this.analyze(response); } } export { AttackAnalysisEngine, EventAnalysisEngine, ResponseAnalysisEngine };