Class RedactionConfig

java.lang.Object
ai.nightfall.scan.model.redaction.RedactionConfig

public class RedactionConfig extends Object
An object that configures how any detected findings should be redacted when returned to the client. When this configuration is provided as part of a request, exactly one of the four types of redaction should be set.

Four types of redaction are supported:

  1. Masking: replacing the characters of a finding with another character, such as '*' or '👀'
  2. Info Type Substitution: replacing the finding with the name of the detector it matched, such as CREDIT_CARD_NUMBER
  3. Substitution: replacing the finding with a custom string, such as "oh no!"
  4. Encryption: encrypting the finding with an RSA public key
  • Constructor Details

    • RedactionConfig

      public RedactionConfig(MaskConfig maskConfig)
      Build a redaction config with masking.
      Parameters:
      maskConfig - the masking configuration
    • RedactionConfig

      public RedactionConfig(InfoTypeSubstitutionConfig infoTypeSubstitutionConfig)
      Build a redaction config with info type substitution.
      Parameters:
      infoTypeSubstitutionConfig - the info type substitution configuration
    • RedactionConfig

      public RedactionConfig(SubstitutionConfig substitutionConfig)
      Build a redaction config with substitution.
      Parameters:
      substitutionConfig - the substitution configuration
    • RedactionConfig

      public RedactionConfig(CryptoConfig cryptoConfig)
      Build a redaction config with RSA encryption.
      Parameters:
      cryptoConfig - the crypto configuration
  • Method Details

    • getMaskConfig

      public MaskConfig getMaskConfig()
      Get the masking configuration.
      Returns:
      the masking configuration
    • getInfoTypeSubstitutionConfig

      public InfoTypeSubstitutionConfig getInfoTypeSubstitutionConfig()
      Get the info type substitution configuration.
      Returns:
      the info type substitution configuration
    • getSubstitutionConfig

      public SubstitutionConfig getSubstitutionConfig()
      Get the substitution configuration.
      Returns:
      the substitution configuration
    • getCryptoConfig

      public CryptoConfig getCryptoConfig()
      Get the encryption configuration.
      Returns:
      the encryption configuration
    • isRemoveFinding

      public boolean isRemoveFinding()
      Returns whether the original finding should be omitted in responses from the API.
      Returns:
      true if the original finding should be omitted in responses from the API, false otherwise
    • setRemoveFinding

      public void setRemoveFinding(boolean removeFinding)
      Sets whether the original finding should be omitted in responses from the API.
      Parameters:
      removeFinding - true if the original finding should be omitted in responses from the API, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object