diff --git a/monkey/common/event_serializers/__init__.py b/monkey/common/event_serializers/__init__.py index 2fd901681..e8c35607d 100644 --- a/monkey/common/event_serializers/__init__.py +++ b/monkey/common/event_serializers/__init__.py @@ -1,5 +1,5 @@ from .consts import EVENT_TYPE_FIELD from .i_agent_event_serializer import IAgentEventSerializer, JSONSerializable -from .event_serializer_registry import EventSerializerRegistry +from .event_serializer_registry import AgentEventSerializerRegistry from .pydantic_event_serializer import PydanticEventSerializer from .register import register_common_agent_event_serializers diff --git a/monkey/common/event_serializers/event_serializer_registry.py b/monkey/common/event_serializers/event_serializer_registry.py index 09134798b..c750a1e89 100644 --- a/monkey/common/event_serializers/event_serializer_registry.py +++ b/monkey/common/event_serializers/event_serializer_registry.py @@ -4,12 +4,12 @@ from common.event_serializers import IAgentEventSerializer from common.events import AbstractAgentEvent -class EventSerializerRegistry: +class AgentEventSerializerRegistry: """ Registry for event serializers using event class. Example: - event_serializer_registry = EventSerializerRegistry() + event_serializer_registry = AgentEventSerializerRegistry() event_serializer_registry[MyEvent] = MyEventSerializer() my_event_dict = {"type": "MyEvent", "data": "123"} diff --git a/monkey/common/event_serializers/register.py b/monkey/common/event_serializers/register.py index 6c533c9bf..ddf6a288d 100644 --- a/monkey/common/event_serializers/register.py +++ b/monkey/common/event_serializers/register.py @@ -1,9 +1,11 @@ from common.events import CredentialsStolenEvent -from . import EventSerializerRegistry, PydanticEventSerializer +from . import AgentEventSerializerRegistry, PydanticEventSerializer -def register_common_agent_event_serializers(event_serializer_registry: EventSerializerRegistry): +def register_common_agent_event_serializers( + event_serializer_registry: AgentEventSerializerRegistry, +): event_serializer_registry[CredentialsStolenEvent] = PydanticEventSerializer( CredentialsStolenEvent )