You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add DLP code samples for custom info types (#1121)
* Add custom info types to code samples
Include samples of using custom dictionaries and custom regexes.
* Add missing imports
* Fix build errors
* Add tests for custom info types
* Fix bad regexes.
* Fix bad regexes, part 2.
* Update README.md
Add custom info type flags and fix existing examples so they work with the V2 API.
* Fix import order
* Fix line length violations
* Fix line length formatting violations
* Fix broken character mask test
DLP now requires the client to specify info types to search for when using DeID with wildcard info types.
* Add SSN info type to tests
* Add info types to DeID with FPE test
Copy file name to clipboardExpand all lines: dlp/README.md
+16-15Lines changed: 16 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -66,49 +66,50 @@ Options:
66
66
-f, --maxFindings [number] [default: 0]
67
67
maximum number of results to retrieve
68
68
-q, --includeQuote [boolean] [default: true] include matching string in results
69
-
-t, --infoTypes restrict to limited set of infoTypes [ default: []]
70
-
[ eg. PHONE_NUMBER US_PASSPORT]
69
+
-t, --infoTypes set of infoTypes to search for [eg. PHONE_NUMBER US_PASSPORT]
70
+
-customDictionaries set of comma-separated dictionary words to search for as customInfoTypes
71
+
-customRegexes set of regex patterns to search for as customInfoTypes
71
72
```
72
73
### Examples
73
74
- Inspect a string:
74
75
```
75
-
java -cp target/dlp-samples-1.0-jar-with-dependencies.jar com.example.dlp.Inspect -s "My phone number is (123) 456-7890 and my email address is [email protected]"
76
+
java -cp target/dlp-samples-1.0-jar-with-dependencies.jar com.example.dlp.Inspect -s "My phone number is (123) 456-7890 and my email address is [email protected]" --infoTypes PHONE_NUMBER EMAIL_ADDRESS
77
+
java -cp target/dlp-samples-1.0-jar-with-dependencies.jar com.example.dlp.Inspect -s "My phone number is (123) 456-7890 and my email address is [email protected]" -customDictionaries [email protected] -customRegexes "\(\d{3}\) \d{3}-\d{4}"
specifies the minimum reporting likelihood threshold.
103
105
104
-
-infoTypes restrict operation to limited set of info types [ default: []]
105
-
[ eg. PHONE_NUMBER US_PASSPORT]
106
+
-infoTypes set of infoTypes to search for [eg. PHONE_NUMBER US_PASSPORT]
106
107
```
107
108
108
109
### Example
109
-
-Replace sensitive data in text with `_REDACTED_`:
110
+
-Redact phone numbers and email addresses from `test.png`:
110
111
```
111
-
java -cp target/dlp-samples-1.0-jar-with-dependencies.jar com.example.dlp.Redact -s "My phone number is (123) 456-7890 and my email address is [email protected]" -r "_REDACTED_"
0 commit comments