fase(5): findings module complete
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
This commit is contained in:
22
dist/modules/findings/application/event-handlers/OnAnomalyDetected.js
vendored
Normal file
22
dist/modules/findings/application/event-handlers/OnAnomalyDetected.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OnAnomalyDetected = void 0;
|
||||
/**
|
||||
* Listens for anomaly_detected events from crawling module
|
||||
* and creates a Finding in the findings module.
|
||||
*/
|
||||
class OnAnomalyDetected {
|
||||
constructor(createFinding) {
|
||||
this.createFinding = createFinding;
|
||||
}
|
||||
async handle(event) {
|
||||
const payload = event.payload;
|
||||
if (!payload.anomaly || !payload.sessionId)
|
||||
return;
|
||||
await this.createFinding.execute({
|
||||
anomaly: payload.anomaly,
|
||||
sessionId: payload.sessionId,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.OnAnomalyDetected = OnAnomalyDetected;
|
||||
Reference in New Issue
Block a user