fase(6): fuzzing module complete
This commit is contained in:
18
dist/modules/fuzzing/domain/value-objects/FuzzIntensity.js
vendored
Normal file
18
dist/modules/fuzzing/domain/value-objects/FuzzIntensity.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FuzzIntensity = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FuzzIntensity extends ValueObject_1.ValueObject {
|
||||
static low() { return new FuzzIntensity({ value: 'low' }); }
|
||||
static medium() { return new FuzzIntensity({ value: 'medium' }); }
|
||||
static high() { return new FuzzIntensity({ value: 'high' }); }
|
||||
static fromString(s) {
|
||||
if (!FuzzIntensity.LEVELS.includes(s)) {
|
||||
throw new Error(`Invalid intensity: ${s}. Must be one of: ${FuzzIntensity.LEVELS.join(', ')}`);
|
||||
}
|
||||
return new FuzzIntensity({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.FuzzIntensity = FuzzIntensity;
|
||||
FuzzIntensity.LEVELS = ['low', 'medium', 'high'];
|
||||
12
dist/modules/fuzzing/domain/value-objects/FuzzPayload.js
vendored
Normal file
12
dist/modules/fuzzing/domain/value-objects/FuzzPayload.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FuzzPayload = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FuzzPayload extends ValueObject_1.ValueObject {
|
||||
static create(value, strategy) {
|
||||
return new FuzzPayload({ value, strategy });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
get strategy() { return this.props.strategy; }
|
||||
}
|
||||
exports.FuzzPayload = FuzzPayload;
|
||||
20
dist/modules/fuzzing/domain/value-objects/FuzzStrategy.js
vendored
Normal file
20
dist/modules/fuzzing/domain/value-objects/FuzzStrategy.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FuzzStrategy = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FuzzStrategy extends ValueObject_1.ValueObject {
|
||||
static empty() { return new FuzzStrategy({ value: 'empty' }); }
|
||||
static oversized() { return new FuzzStrategy({ value: 'oversized' }); }
|
||||
static specialChars() { return new FuzzStrategy({ value: 'special_chars' }); }
|
||||
static typeMismatch() { return new FuzzStrategy({ value: 'type_mismatch' }); }
|
||||
static boundary() { return new FuzzStrategy({ value: 'boundary' }); }
|
||||
static fromString(s) {
|
||||
if (!FuzzStrategy.ALL.includes(s)) {
|
||||
throw new Error(`Invalid fuzz strategy: ${s}`);
|
||||
}
|
||||
return new FuzzStrategy({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.FuzzStrategy = FuzzStrategy;
|
||||
FuzzStrategy.ALL = ['empty', 'oversized', 'special_chars', 'type_mismatch', 'boundary'];
|
||||
17
dist/modules/fuzzing/domain/value-objects/Seed.js
vendored
Normal file
17
dist/modules/fuzzing/domain/value-objects/Seed.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Seed = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class Seed extends ValueObject_1.ValueObject {
|
||||
static create(value) {
|
||||
if (!Number.isInteger(value) || value < 0) {
|
||||
throw new Error(`Seed must be a non-negative integer, got: ${value}`);
|
||||
}
|
||||
return new Seed({ value });
|
||||
}
|
||||
static fromTimestamp() {
|
||||
return new Seed({ value: Date.now() });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.Seed = Seed;
|
||||
Reference in New Issue
Block a user