Island: add monkey guid to credentials object

This commit is contained in:
vakarisz 2022-02-23 11:42:10 +02:00
parent 1fe1293405
commit a1073bdb34
2 changed files with 10 additions and 5 deletions

View File

@ -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,
)

View File

@ -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: