Agent: Add return to get credentials method in Credentials Store

This commit is contained in:
Ilija Lazoroski 2022-03-28 21:15:57 +02:00
parent d434c20bcb
commit ccb0337aef
2 changed files with 3 additions and 2 deletions

View File

@ -41,6 +41,7 @@ class AggregatingCredentialsStore(ICredentialsStore):
try:
propagation_credentials = self._control_channel.get_credentials_for_propagation()
self._aggregate_credentials(propagation_credentials)
return self.stored_credentials
except Exception as ex:
self.stored_credentials = {}
logger.error(f"Error while attempting to retrieve credentials for propagation: {ex}")

View File

@ -1,5 +1,5 @@
import abc
from typing import Iterable
from typing import Iterable, Mapping
from infection_monkey.i_puppet import Credentials
@ -13,7 +13,7 @@ class ICredentialsStore(metaclass=abc.ABCMeta):
"""
@abc.abstractmethod
def get_credentials(self) -> None:
def get_credentials(self) -> Mapping:
"""
Method that retrieves credentials from the store
:return: Credentials that can be used for propagation