From 8b43d910b6e685e95b0227e3fb720738f0245284 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 21 Jul 2022 19:45:16 +0530 Subject: [PATCH] BB: Modify MonkeyIslandClient.import_config() to send propagation credentials to relevant endpoint --- .../blackbox/island_client/monkey_island_client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 8f2df7131..9cc52413b 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py @@ -32,9 +32,16 @@ class MonkeyIslandClient(object): @avoid_race_condition def import_config(self, test_configuration: TestConfiguration): - _ = self.requests.post( + self.requests.post( "api/agent-configuration", data=test_configuration.agent_configuration.to_json() ) + serialized_propagation_credentials = json.dumps( + [credential.to_json() for credential in test_configuration.propagation_credentials] + ) + self.requests.post( + "/api/propagation-credentials/configured-credentials", + data=serialized_propagation_credentials, + ) @avoid_race_condition def run_monkey_local(self):