Skip to content

Commit

Permalink
add masking_white_list to SmartAppToMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Давыдьян Данил Андраникович committed Oct 4, 2023
1 parent 6f0b79d commit a5cd58a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions smart_kit/message/smartapp_to_message.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from functools import cached_property
from typing import Iterable
from typing import Iterable, Optional, List
import json
from copy import copy

from core.basic_models.actions.command import Command
from core.utils.masking_message import masking
from core.message.msg_validator import MessageValidator
from smart_kit.request.kafka_request import SmartKitKafkaRequest
Expand All @@ -13,15 +14,17 @@ class SmartAppToMessage:
ROOT_NODES_KEY = "root_nodes"
PAYLOAD = "payload"

def __init__(self, command, message, request: SmartKitKafkaRequest, forward_fields=None, masking_fields=None,
validators: Iterable[MessageValidator] = (), **kwargs):
def __init__(self, command: Command, message, request: SmartKitKafkaRequest,
forward_fields=None, masking_fields=None, validators: Iterable[MessageValidator] = (),
masking_white_list: Optional[List[str]] = None, **kwargs):
root_nodes = command.payload.pop(self.ROOT_NODES_KEY, None)
self.command = command
self.root_nodes = root_nodes or {}
self.incoming_message = message
self.request = request
self.forward_fields = forward_fields or ()
self.masking_fields = masking_fields
self.masking_white_list = masking_white_list
self.validators = validators
self._kwargs = kwargs

Expand Down

0 comments on commit a5cd58a

Please sign in to comment.