Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLP-1723: add ocr_enabled flag to DLP profiles #1600

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1600.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
dlp: Adds support for ocr_enabled boolean flag
```
1 change: 1 addition & 0 deletions dlp_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type DLPProfile struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
AllowedMatchCount int `json:"allowed_match_count"`
OCREnabled *bool `json:"ocr_enabled,omitempty"`

ContextAwareness *DLPContextAwareness `json:"context_awareness,omitempty"`

Expand Down
12 changes: 9 additions & 3 deletions dlp_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func TestDLPProfiles(t *testing.T) {
"skip": {
"files": true
}
}
},
"ocr_enabled": false
},
{
"id": "29678c26-a191-428d-9f63-6e20a4a636a4",
Expand All @@ -75,7 +76,8 @@ func TestDLPProfiles(t *testing.T) {
"updated_at": "2022-10-18T08:00:57Z",
"type": "custom",
"description": "just a custom profile example",
"allowed_match_count": 1
"allowed_match_count": 1,
"ocr_enabled": true
}
]
}
Expand All @@ -98,6 +100,7 @@ func TestDLPProfiles(t *testing.T) {
Files: BoolPtr(true),
},
},
OCREnabled: BoolPtr(false),
Entries: []DLPEntry{
{
ID: "111b9d4b-a5c6-40f0-957d-9d53b25dd84a",
Expand All @@ -121,6 +124,7 @@ func TestDLPProfiles(t *testing.T) {
Description: "just a custom profile example",
AllowedMatchCount: 1,
// Omit ContextAwareness to test ContextAwareness optionality
OCREnabled: BoolPtr(true),
Entries: []DLPEntry{
{
ID: "ef79b054-12d4-4067-bb30-b85f6267b91c",
Expand Down Expand Up @@ -271,7 +275,8 @@ func TestCreateDLPCustomProfiles(t *testing.T) {
"updated_at": "2022-10-18T08:00:57Z",
"type": "custom",
"description": "`+requestProfile.Description+`",
"allowed_match_count": 0
"allowed_match_count": 0,
"ocr_enabled": true
}]
}`)
}
Expand Down Expand Up @@ -303,6 +308,7 @@ func TestCreateDLPCustomProfiles(t *testing.T) {
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
AllowedMatchCount: 0,
OCREnabled: BoolPtr(true),
},
}

Expand Down
Loading