From 520183f42d6e785c8955337f70853a20c1e87a0f Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 29 Aug 2022 13:28:50 +0530 Subject: [PATCH] Common: Create PluginConfiguration using pydantic --- .../agent_sub_configurations.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index be1c9ca87..a01767227 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -90,6 +90,32 @@ class PluginConfiguration: options: Dict +class Pydantic___PluginConfiguration(MutableInfectionMonkeyBaseModel): + """ + A configuration for plugins + + Attributes: + :param name: Name of the plugin + Example: "ransomware" + :param options: Any other information/configuration fields relevant to the plugin + Example: { + "encryption": { + "enabled": True, + "directories": { + "linux_target_dir": "~/this_dir", + "windows_target_dir": "C:\that_dir" + }, + }, + "other_behaviors": { + "readme": True + }, + } + """ + + name: str + options: Dict + + @dataclass(frozen=True) class ScanTargetConfiguration: """