11package ai .nightfall .scan .model ;
22
3+ import ai .nightfall .scan .model .redaction .RedactionConfig ;
34import com .fasterxml .jackson .annotation .JsonProperty ;
45
56import java .util .List ;
@@ -19,6 +20,9 @@ public class ScanTextConfig {
1920 @ JsonProperty ("contextBytes" )
2021 private int contextBytes ;
2122
23+ @ JsonProperty ("defaultRedactionConfig" )
24+ private RedactionConfig defaultRedactionConfig ;
25+
2226 /**
2327 * Create a scan configuration with the provided detection rules.
2428 *
@@ -54,6 +58,22 @@ public ScanTextConfig(List<UUID> detectionRuleUUIDs, List<DetectionRule> detecti
5458 this .contextBytes = contextBytes ;
5559 }
5660
61+ /**
62+ * Create a scan configuration with the provided inline detection rules and detection rule UUIDs.
63+ *
64+ * @param detectionRuleUUIDs a list of detection rules to use to scan content (maximum length 10)
65+ * @param detectionRules a list of detection rules to use to scan content (maximum length 10)
66+ * @param contextBytes the number of bytes of context (leading and trailing) to return with any matched findings
67+ * @param defaultRedactionConfig the default redaction configuration to apply to all detection rules
68+ */
69+ public ScanTextConfig (List <UUID > detectionRuleUUIDs , List <DetectionRule > detectionRules , int contextBytes ,
70+ RedactionConfig defaultRedactionConfig ) {
71+ this .detectionRuleUUIDs = detectionRuleUUIDs ;
72+ this .detectionRules = detectionRules ;
73+ this .contextBytes = contextBytes ;
74+ this .defaultRedactionConfig = defaultRedactionConfig ;
75+ }
76+
5777 /**
5878 * Get the detection rule UUIDs.
5979 *
@@ -108,12 +128,33 @@ public void setContextBytes(int contextBytes) {
108128 this .contextBytes = contextBytes ;
109129 }
110130
131+ /**
132+ * Get the default redaction configuration to-be-applied to all detection rules, unless a more specific redaction
133+ * configuration is supplied at the detector level.
134+ *
135+ * @return the default redaction configuration
136+ */
137+ public RedactionConfig getDefaultRedactionConfig () {
138+ return defaultRedactionConfig ;
139+ }
140+
141+ /**
142+ * Set the default redaction configuration to-be-applied to all detection rules, unless a more specific redaction
143+ * configuration is supplied at the detector level.
144+ *
145+ * @param defaultRedactionConfig the default redaction configuration
146+ */
147+ public void setDefaultRedactionConfig (RedactionConfig defaultRedactionConfig ) {
148+ this .defaultRedactionConfig = defaultRedactionConfig ;
149+ }
150+
111151 @ Override
112152 public String toString () {
113153 return "ScanTextConfig{"
114154 + "detectionRuleUUIDs=" + detectionRuleUUIDs
115155 + ", detectionRules=" + detectionRules
116156 + ", contextBytes=" + contextBytes
157+ + ", defaultRedactionConfig=" + defaultRedactionConfig
117158 + '}' ;
118159 }
119160}
0 commit comments