Common: Add maximum_depth to PropagationConfiguration

This commit is contained in:
Mike Salvatore 2022-06-17 09:07:13 -04:00
parent a41b2e3ea4
commit bd7ea7fdb1
2 changed files with 4 additions and 1 deletions

View File

@ -156,11 +156,13 @@ class ExploitationConfigurationSchema(Schema):
@dataclass(frozen=True) @dataclass(frozen=True)
class PropagationConfiguration: class PropagationConfiguration:
maximum_depth: int
network_scan: NetworkScanConfiguration network_scan: NetworkScanConfiguration
exploitation: ExploitationConfiguration exploitation: ExploitationConfiguration
class PropagationConfigurationSchema(Schema): class PropagationConfigurationSchema(Schema):
maximum_depth = fields.Int()
network_scan = fields.Nested(NetworkScanConfigurationSchema) network_scan = fields.Nested(NetworkScanConfigurationSchema)
exploitation = fields.Nested(ExploitationConfigurationSchema) exploitation = fields.Nested(ExploitationConfigurationSchema)

View File

@ -181,6 +181,7 @@ def test_exploitation_configuration():
PROPAGATION_CONFIGURATION = { PROPAGATION_CONFIGURATION = {
"maximum_depth": 5,
"network_scan": NETWORK_SCAN_CONFIGURATION, "network_scan": NETWORK_SCAN_CONFIGURATION,
"exploitation": EXPLOITATION_CONFIGURATION, "exploitation": EXPLOITATION_CONFIGURATION,
} }
@ -195,5 +196,5 @@ def test_propagation_configuration():
assert isinstance(config, PropagationConfiguration) assert isinstance(config, PropagationConfiguration)
assert isinstance(config.network_scan, NetworkScanConfiguration) assert isinstance(config.network_scan, NetworkScanConfiguration)
assert isinstance(config.exploitation, ExploitationConfiguration) assert isinstance(config.exploitation, ExploitationConfiguration)
assert config.maximum_depth == 5
assert config_dict == PROPAGATION_CONFIGURATION assert config_dict == PROPAGATION_CONFIGURATION