Common: Rename marshmallow post_load methods to be protected

This commit is contained in:
Mike Salvatore 2022-06-17 08:22:14 -04:00
parent ee8e949a0d
commit 7e9c481992
2 changed files with 13 additions and 12 deletions

View File

@ -22,7 +22,7 @@ class CustomPBAConfigurationSchema(Schema):
windows_filename = fields.Str() windows_filename = fields.Str()
@post_load @post_load
def make_custom_pba_configuration(self, data, **kwargs): def _make_custom_pba_configuration(self, data, **kwargs):
return CustomPBAConfiguration(**data) return CustomPBAConfiguration(**data)
@ -37,7 +37,7 @@ class PluginConfigurationSchema(Schema):
options = fields.Mapping() options = fields.Mapping()
@post_load @post_load
def make_plugin_configuration(self, data, **kwargs): def _make_plugin_configuration(self, data, **kwargs):
return PluginConfiguration(**data) return PluginConfiguration(**data)
@ -50,7 +50,7 @@ class ExploitationOptionsConfigurationSchema(Schema):
http_ports = fields.List(fields.Int()) http_ports = fields.List(fields.Int())
@post_load @post_load
def make_exploitation_options_configuration(self, data, **kwargs): def _make_exploitation_options_configuration(self, data, **kwargs):
return ExploitationOptionsConfiguration(**data) return ExploitationOptionsConfiguration(**data)
@ -67,7 +67,7 @@ class ExploiterConfigurationSchema(Schema):
supported_os = fields.List(EnumField(OperatingSystems)) supported_os = fields.List(EnumField(OperatingSystems))
@post_load @post_load
def make_exploiter_configuration(self, data, **kwargs): def _make_exploiter_configuration(self, data, **kwargs):
return ExploiterConfiguration(**data) return ExploiterConfiguration(**data)
@ -84,7 +84,7 @@ class ExploitationConfigurationSchema(Schema):
vulnerability = fields.List(fields.Nested(ExploiterConfigurationSchema)) vulnerability = fields.List(fields.Nested(ExploiterConfigurationSchema))
@post_load @post_load
def make_exploitation_options_configuration(self, data, **kwargs): def _make_exploitation_options_configuration(self, data, **kwargs):
return ExploitationConfiguration(**data) return ExploitationConfiguration(**data)
@ -105,7 +105,7 @@ class ICMPScanConfigurationSchema(Schema):
timeout_ms = fields.Int() timeout_ms = fields.Int()
@post_load @post_load
def make_icmp_scan_configuration(self, data, **kwargs): def _make_icmp_scan_configuration(self, data, **kwargs):
return ICMPScanConfiguration(**data) return ICMPScanConfiguration(**data)
@ -120,5 +120,5 @@ class TCPScanConfigurationSchema(Schema):
ports = fields.List(fields.Int()) ports = fields.List(fields.Int())
@post_load @post_load
def make_tcp_scan_configuration(self, data, **kwargs): def _make_tcp_scan_configuration(self, data, **kwargs):
return TCPScanConfiguration(**data) return TCPScanConfiguration(**data)

View File

@ -186,11 +186,12 @@ response_code # unused variable (monkey/monkey_island/cc/services/aws/aws_comma
# Agent Configuration # Agent Configuration
Meta # unused class (monkey/common/configuration/agent_configuration.py:13) Meta # unused class (monkey/common/configuration/agent_configuration.py:13)
unknown # unused variable (monkey/common/configuration/agent_configuration.py:14) unknown # unused variable (monkey/common/configuration/agent_configuration.py:14)
make_plugin_configuration # unused method (monkey/common/configuration/agent_configuration.py:19) _make_plugin_configuration # unused method (monkey/common/configuration/agent_configuration.py:19)
make_custom_pba_configuration # unused method (monkey/common/configuration/agent_configuration.py:34) _make_custom_pba_configuration # unused method (monkey/common/configuration/agent_configuration.py:24)
make_exploitation_options_configuration # unused method (monkey/common/configuration/agent_configuration.py:58) _make_exploiter_configuration # unused method (monkey/common/configuration/agent_configuration.py:69)
make_exploiter_configuration # unused method (monkey/common/configuration/agent_configuration.py:62) _make_exploitation_options_configuration # unused method (monkey/common/configuration/agent_configuration.py:86)
make_tcp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:114) _make_icmp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:107)
_make_tcp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:122)
LINUX # unused variable (monkey/common/operating_systems.py:5) LINUX # unused variable (monkey/common/operating_systems.py:5)
WINDOWS # unused variable (monkey/common/operating_systems.py:6) WINDOWS # unused variable (monkey/common/operating_systems.py:6)