@appsensorlike/appsensorlike
Version:
A port of OWASP AppSensor reference implementation
46 lines (45 loc) • 1.88 kB
TypeScript
import { AppSensorEvent, Attack, Response } from "../core.js";
import { AttackListener, EventListener, ResponseListener } from "../listener/listener.js";
/**
* 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>.
*/
declare abstract class AttackAnalysisEngine implements AttackListener {
onAdd(attack: Attack): Promise<void>;
abstract analyze(attack: Attack): Promise<void>;
}
/**
* 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>.
*/
declare abstract class EventAnalysisEngine implements EventListener {
onAdd(event: AppSensorEvent): Promise<void>;
abstract analyze(event: AppSensorEvent): Promise<void>;
}
/**
* 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>.
*/
declare abstract class ResponseAnalysisEngine implements ResponseListener {
onAdd(response: Response): Promise<void>;
abstract analyze(response: Response): Promise<void>;
}
export { AttackAnalysisEngine, EventAnalysisEngine, ResponseAnalysisEngine };