From fad0c5fe4d1727aaf459a69c9098fd16e5e981f2 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 26 Jul 2022 16:42:06 +0530 Subject: [PATCH 1/3] Common: Add docstring to PluginConfiguration dataclass --- .../agent_sub_configurations.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index 188b9d1bb..b4cc80eaa 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -27,6 +27,25 @@ class CustomPBAConfiguration: @dataclass(frozen=True) class PluginConfiguration: + """ + Dataclass for the configuration of plugins + + :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 From f941c2aa35b6b721edc3225ed27001af73f08dac Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 26 Jul 2022 18:47:59 +0530 Subject: [PATCH 2/3] Common: Reword PluginConfiguration docstring description --- monkey/common/agent_configuration/agent_sub_configurations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index b4cc80eaa..7707a9bde 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -28,7 +28,7 @@ class CustomPBAConfiguration: @dataclass(frozen=True) class PluginConfiguration: """ - Dataclass for the configuration of plugins + A configuration for plugins :param name: Name of the plugin. Example: "ransomware" From 856ce4925b56c1a769e24fa82337561b5bbb9293 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 27 Jul 2022 13:12:45 +0530 Subject: [PATCH 3/3] Common: Fix docstring format in PluginConfiguration --- .../agent_sub_configurations.py | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index 7707a9bde..5c054d471 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -30,22 +30,24 @@ class PluginConfiguration: """ A configuration for plugins - :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" + 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 - }, - } + "other_behaviors": { + "readme": True + }, + } """ + name: str options: Dict