From 093e6fa3a6666214fe1f9c8b245738e80504c3d4 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 14 Jul 2022 14:14:33 +0530 Subject: [PATCH] Island: Add init and IAgentConfigurationRepository dependency to Telemetry resource --- monkey/monkey_island/cc/resources/telemetry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monkey/monkey_island/cc/resources/telemetry.py b/monkey/monkey_island/cc/resources/telemetry.py index 8b6bf790a..32e8e1a23 100644 --- a/monkey/monkey_island/cc/resources/telemetry.py +++ b/monkey/monkey_island/cc/resources/telemetry.py @@ -8,6 +8,7 @@ from flask import request from monkey_island.cc.database import mongo from monkey_island.cc.models.monkey import Monkey from monkey_island.cc.models.telemetries import get_telemetry_by_query +from monkey_island.cc.repository import IAgentConfigurationRepository from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required from monkey_island.cc.services.node import NodeService @@ -20,6 +21,9 @@ class Telemetry(AbstractResource): # API Spec: Resource name should be plural urls = ["/api/telemetry", "/api/telemetry/"] + def __init__(self, agent_configuration_repository: IAgentConfigurationRepository): + self._agent_configuration_repository = agent_configuration_repository + @jwt_required def get(self, **kw): monkey_guid = request.args.get("monkey_guid")