diff --git a/monkey/infection_monkey/telemetry/telem_encoder.py b/monkey/infection_monkey/telemetry/telem_encoder.py index 224e14133..ec060b250 100644 --- a/monkey/infection_monkey/telemetry/telem_encoder.py +++ b/monkey/infection_monkey/telemetry/telem_encoder.py @@ -1,6 +1,6 @@ import json -from pydantic import BaseModel, SecretField +from pydantic import BaseModel, SecretBytes, SecretStr from common import OperatingSystem @@ -11,6 +11,6 @@ class TelemetryJSONEncoder(json.JSONEncoder): return obj.name if issubclass(type(obj), BaseModel): return obj.dict(simplify=True) - if issubclass(type(obj), SecretField): + if issubclass(type(obj), (SecretStr, SecretBytes)): return obj.get_secret_value() return json.JSONEncoder.default(self, obj)