From e497a81334661257bc5d97974b1419c4601e0bd7 Mon Sep 17 00:00:00 2001 From: Inanna Malick Date: Mon, 18 Mar 2024 13:42:01 -0700 Subject: [PATCH 1/2] DLP-1723: add ocr_enabled flag to DLP profiles --- dlp_profile.go | 1 + dlp_profile_test.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlp_profile.go b/dlp_profile.go index 2a0c405da8d..25e78e9c446 100644 --- a/dlp_profile.go +++ b/dlp_profile.go @@ -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"` diff --git a/dlp_profile_test.go b/dlp_profile_test.go index 67f014d5ab0..3345c3dd35a 100644 --- a/dlp_profile_test.go +++ b/dlp_profile_test.go @@ -51,7 +51,8 @@ func TestDLPProfiles(t *testing.T) { "skip": { "files": true } - } + }, + "ocr_enabled": false }, { "id": "29678c26-a191-428d-9f63-6e20a4a636a4", @@ -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 } ] } @@ -98,6 +100,7 @@ func TestDLPProfiles(t *testing.T) { Files: BoolPtr(true), }, }, + OCREnabled: BoolPtr(false), Entries: []DLPEntry{ { ID: "111b9d4b-a5c6-40f0-957d-9d53b25dd84a", @@ -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", @@ -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 }] }`) } @@ -303,6 +308,7 @@ func TestCreateDLPCustomProfiles(t *testing.T) { CreatedAt: &createdAt, UpdatedAt: &updatedAt, AllowedMatchCount: 0, + OCREnabled: BoolPtr(true), }, } From 2c515ee51da1f91272aab58163421bf3abe5fcac Mon Sep 17 00:00:00 2001 From: Inanna Malick Date: Fri, 22 Mar 2024 10:07:29 -0700 Subject: [PATCH 2/2] add changelog --- .changelog/1600.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/1600.txt diff --git a/.changelog/1600.txt b/.changelog/1600.txt new file mode 100644 index 00000000000..eee34a8637d --- /dev/null +++ b/.changelog/1600.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +dlp: Adds support for ocr_enabled boolean flag +```