forked from p15670423/monkey
Island: add monkey guid to credentials object
This commit is contained in:
parent
1fe1293405
commit
a1073bdb34
|
@ -8,7 +8,12 @@ from typing import Sequence
|
|||
class Credentials:
|
||||
identities: Sequence[dict]
|
||||
secrets: Sequence[dict]
|
||||
monkey_guid: str
|
||||
|
||||
@staticmethod
|
||||
def from_dict(cred_dict: dict) -> Credentials:
|
||||
return Credentials(identities=cred_dict["identities"], secrets=cred_dict["secrets"])
|
||||
def from_dict(cred_dict: dict, monkey_guid: str) -> Credentials:
|
||||
return Credentials(
|
||||
identities=cred_dict["identities"],
|
||||
secrets=cred_dict["secrets"],
|
||||
monkey_guid=monkey_guid,
|
||||
)
|
||||
|
|
|
@ -24,10 +24,10 @@ IDENTITY_PROCESSORS = {
|
|||
}
|
||||
|
||||
|
||||
def parse_credentials(credentials_dict: Mapping):
|
||||
def parse_credentials(telemetry_dict: Mapping):
|
||||
credentials = [
|
||||
Credentials(credential["identities"], credential["secrets"])
|
||||
for credential in credentials_dict["data"]
|
||||
Credentials.from_dict(credential, telemetry_dict["monkey_guid"])
|
||||
for credential in telemetry_dict["data"]
|
||||
]
|
||||
|
||||
for credential in credentials:
|
||||
|
|
Loading…
Reference in New Issue