Class RedactionConfig
java.lang.Object
ai.nightfall.scan.model.redaction.RedactionConfig
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:
- Masking: replacing the characters of a finding with another character, such as '*' or '👀'
- Info Type Substitution: replacing the finding with the name of the detector it matched, such as CREDIT_CARD_NUMBER
- Substitution: replacing the finding with a custom string, such as "oh no!"
- Encryption: encrypting the finding with an RSA public key
-
Constructor Summary
ConstructorsConstructorDescriptionRedactionConfig(CryptoConfig cryptoConfig) Build a redaction config with RSA encryption.RedactionConfig(InfoTypeSubstitutionConfig infoTypeSubstitutionConfig) Build a redaction config with info type substitution.RedactionConfig(MaskConfig maskConfig) Build a redaction config with masking.RedactionConfig(SubstitutionConfig substitutionConfig) Build a redaction config with substitution. -
Method Summary
Modifier and TypeMethodDescriptionGet the encryption configuration.Get the info type substitution configuration.Get the masking configuration.Get the substitution configuration.booleanReturns whether the original finding should be omitted in responses from the API.voidsetRemoveFinding(boolean removeFinding) Sets whether the original finding should be omitted in responses from the API.toString()
-
Constructor Details
-
RedactionConfig
Build a redaction config with masking.- Parameters:
maskConfig- the masking configuration
-
RedactionConfig
Build a redaction config with info type substitution.- Parameters:
infoTypeSubstitutionConfig- the info type substitution configuration
-
RedactionConfig
Build a redaction config with substitution.- Parameters:
substitutionConfig- the substitution configuration
-
RedactionConfig
Build a redaction config with RSA encryption.- Parameters:
cryptoConfig- the crypto configuration
-
-
Method Details
-
getMaskConfig
Get the masking configuration.- Returns:
- the masking configuration
-
getInfoTypeSubstitutionConfig
Get the info type substitution configuration.- Returns:
- the info type substitution configuration
-
getSubstitutionConfig
Get the substitution configuration.- Returns:
- the substitution configuration
-
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
-