Agent: Add from_dict method to AgentConfiguration

Creating AgentConfiguration object from dictionary makes sense because it doesn't couple the configuration to any specific serialization methods. Also, the json sent from the island doesn't match the config structure because it stores config in a dict under "config" key.
This commit is contained in:
vakarisz 2022-06-20 16:29:53 +03:00 committed by Mike Salvatore
parent d079d74b2c
commit 77804caab5
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,10 @@ class AgentConfiguration:
payloads: List[PluginConfiguration]
propagation: PropagationConfiguration
@staticmethod
def from_dict(_dict: dict):
return AgentConfigurationSchema().load(_dict)
class AgentConfigurationSchema(Schema):
keep_tunnel_open_time = fields.Float()