diff --git a/sekoia_automation/account_validator.py b/sekoia_automation/account_validator.py index b8d3439..9b94258 100644 --- a/sekoia_automation/account_validator.py +++ b/sekoia_automation/account_validator.py @@ -9,7 +9,7 @@ class AccountValidator(ModuleItem): VALIDATION_CALLBACK_URL_FILE_NAME = "validation_callback_url" @abstractmethod - def validator(self) -> bool: + def validate(self) -> bool: """To define in subclasses. Validates the configuration of the module. Returns: @@ -20,18 +20,8 @@ def execute(self): """Validates the account (module_configuration) of the module and sends the result to Symphony.""" # Call the actual validation procedure - status = self.validator() + status = self.validate() # Return result of validation to Symphony data = {"validation_status": status} - validation_callback_url = self.module.load_config( - self.VALIDATION_CALLBACK_URL_FILE_NAME - ) - response = requests.request( - "POST", - validation_callback_url, - json=data, - headers={"Authorization": f"Bearer {self.token}"}, - timeout=30, - ) - response.raise_for_status() + self._send_request(data)