forked from p15670423/monkey
Island: Use ICredentialsRepository to retrieve propagation credentials
This commit is contained in:
parent
45b2558ddd
commit
dc1eb5f12c
|
@ -1,15 +1,16 @@
|
||||||
|
from flask import make_response
|
||||||
|
|
||||||
|
from monkey_island.cc.repository import ICredentialsRepository
|
||||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||||
from monkey_island.cc.services.config import ConfigService
|
|
||||||
|
|
||||||
|
|
||||||
class PropagationCredentials(AbstractResource):
|
class PropagationCredentials(AbstractResource):
|
||||||
urls = ["/api/propagation-credentials"]
|
urls = ["/api/propagation-credentials"]
|
||||||
|
|
||||||
|
def __init__(self, credentials_repository: ICredentialsRepository):
|
||||||
|
self._credentials_repository = credentials_repository
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
config = ConfigService.get_flat_config(should_decrypt=True)
|
propagation_credentials = self._credentials_repository.get_all_credentials()
|
||||||
|
|
||||||
propagation_credentials = ConfigService.get_config_propagation_credentials_from_flat_config(
|
return make_response({"propagation_credentials": propagation_credentials})
|
||||||
config
|
|
||||||
)
|
|
||||||
|
|
||||||
return {"propagation_credentials": propagation_credentials}
|
|
||||||
|
|
Loading…
Reference in New Issue