forked from p15670423/monkey
Island, Agent: Fix bugs in credential object creation
This commit is contained in:
parent
7149c704a2
commit
d347521a29
|
@ -121,7 +121,7 @@ class ControlChannel(IControlChannel):
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
return [Credentials.from_mapping(credentials) for credentials in response.json()]
|
return [Credentials(**credentials) for credentials in response.json()]
|
||||||
except (
|
except (
|
||||||
requests.exceptions.JSONDecodeError,
|
requests.exceptions.JSONDecodeError,
|
||||||
requests.exceptions.ConnectionError,
|
requests.exceptions.ConnectionError,
|
||||||
|
|
|
@ -29,7 +29,7 @@ class PropagationCredentials(AbstractResource):
|
||||||
return propagation_credentials, HTTPStatus.OK
|
return propagation_credentials, HTTPStatus.OK
|
||||||
|
|
||||||
def put(self, collection=None):
|
def put(self, collection=None):
|
||||||
credentials = [Credentials.parse_raw(c) for c in request.json]
|
credentials = [Credentials(**c) for c in request.json]
|
||||||
if collection == _configured_collection:
|
if collection == _configured_collection:
|
||||||
self._credentials_repository.remove_configured_credentials()
|
self._credentials_repository.remove_configured_credentials()
|
||||||
self._credentials_repository.save_configured_credentials(credentials)
|
self._credentials_repository.save_configured_credentials(credentials)
|
||||||
|
|
Loading…
Reference in New Issue