policies/MaskingPolicy.java

kafka-ui · kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/masking/policies/MaskingPolicy.java · java · Apache-2.0
infra

Abstract masking policy for JSON and string data, with factory creation based on masking type.

// Source: https://github.com/provectus/kafka-ui | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package com.provectus.kafka.ui.service.masking.policies;

import com.fasterxml.jackson.databind.node.ContainerNode;
import com.provectus.kafka.ui.config.ClustersProperties;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public abstract class MaskingPolicy {

  public static MaskingPolicy create(ClustersProperties.Masking property) {
    FieldsSelector fieldsSelector = FieldsSelector.create(property);
    return switch (property.getType()) {
      case REMOVE -> new Remove(fieldsSelector);
      case REPLACE -> new Replace(
          fieldsSelector,
          property.

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key