forked from p15670423/monkey
Island, BB: Fix credential conversion to dict bugs
This commit is contained in:
parent
e5574240e9
commit
472ca382f1
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
import logging
|
||||
import time
|
||||
from typing import Sequence, Union
|
||||
from typing import List, Sequence, Union
|
||||
|
||||
from bson import json_util
|
||||
|
||||
|
@ -59,9 +59,9 @@ class MonkeyIslandClient(object):
|
|||
assert False
|
||||
|
||||
@avoid_race_condition
|
||||
def _import_credentials(self, propagation_credentials: Credentials):
|
||||
def _import_credentials(self, propagation_credentials: List[Credentials]):
|
||||
serialized_propagation_credentials = [
|
||||
Credentials.dict(credentials) for credentials in propagation_credentials
|
||||
credentials.dict() for credentials in propagation_credentials
|
||||
]
|
||||
response = self.requests.put_json(
|
||||
"/api/propagation-credentials/configured-credentials",
|
||||
|
|
|
@ -68,7 +68,7 @@ class MongoCredentialsRepository(ICredentialsRepository):
|
|||
def _save_credentials_to_collection(self, credentials: Sequence[Credentials], collection):
|
||||
try:
|
||||
for c in credentials:
|
||||
encrypted_credentials = self._encrypt_credentials_mapping(c.dict())
|
||||
encrypted_credentials = self._encrypt_credentials_mapping(c.dict(simplify=True))
|
||||
collection.insert_one(encrypted_credentials)
|
||||
except Exception as err:
|
||||
raise StorageError(err)
|
||||
|
|
Loading…
Reference in New Issue