From 858b7650acf6160338c15c29e749f73251e23f0d Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 29 Aug 2022 13:45:25 +0530 Subject: [PATCH] Common: Create ICMPScanConfiguration using pydantic --- .../agent_configuration/agent_sub_configurations.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index c8eb5ec64..7dbed4d41 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import Dict, Tuple -from pydantic import validator +from pydantic import PositiveFloat, validator from common.base_models import MutableInfectionMonkeyBaseModel @@ -194,6 +194,17 @@ class ICMPScanConfiguration: timeout: float +class Pydantic___ICMPScanConfiguration(MutableInfectionMonkeyBaseModel): + """ + A configuration for ICMP scanning + + Attributes: + :param timeout: Maximum time in seconds to wait for a response from the target + """ + + timeout: PositiveFloat + + @dataclass(frozen=True) class TCPScanConfiguration: """