From e1691b108f28bab68d8cf59e8a91146e4f928364 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 22 Jul 2022 13:21:25 -0400 Subject: [PATCH] BB: Fix credentials object serialization --- .../blackbox/island_client/monkey_island_client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py index fe9a5fd89..e4636708d 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py @@ -6,6 +6,7 @@ from typing import Union from bson import json_util from common.configuration import AgentConfiguration +from common.credentials import Credentials from envs.monkey_zoo.blackbox.island_client.monkey_island_requests import MonkeyIslandRequests from envs.monkey_zoo.blackbox.test_configurations.test_configuration import TestConfiguration @@ -37,9 +38,10 @@ class MonkeyIslandClient(object): "api/agent-configuration", data=AgentConfiguration.to_mapping(test_configuration.agent_configuration), ) - serialized_propagation_credentials = json.dumps( - [credential.to_json() for credential in test_configuration.propagation_credentials] - ) + serialized_propagation_credentials = [ + Credentials.to_mapping(credentials) + for credentials in test_configuration.propagation_credentials + ] self.requests.post( "/api/propagation-credentials/configured-credentials", data=serialized_propagation_credentials,