Skip to content

DLP: Added sample for inspect string with exclusion dict #3200

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

Conversation

dinesh-crest
Copy link
Contributor

Added test cases for same

Description

Reference:- https://cloud.google.com/dlp/docs/creating-custom-infotypes-rules#omit_specific_email_address_from_email_address_detector_scan

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@dinesh-crest dinesh-crest requested review from a team as code owners May 8, 2023 11:25
@snippet-bot
Copy link

snippet-bot bot commented May 8, 2023

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: dlp Issues related to the Sensitive Data Protection API. samples Issues that are directly related to samples. labels May 8, 2023
@annadata annadata force-pushed the inspect_string_with_exclusion_dict branch from 013fdac to 05e60a2 Compare May 11, 2023 09:57
Comment on lines 464 to 488
`node inspectStringWithExclusionDict.js ${projectId} "Some email addresses: gary@example.com, example@example.com" EMAIL_ADDRESS "gary@example.com"`
);
assert.notMatch(output, /Quote: gary@example.com/);
assert.match(output, /Quote: example@example.com/);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation surrounding this sample says
Cloud DLP using an InspectConfig that it should avoid matching on "example@example.com" in a scan that uses the infoType detector EMAIL_ADDRESS:

The corresponding Java test has
assertThat(output).contains("gary@example.com");
assertThat(output).doesNotContain("example@example.com");
If you do the opposite here, the reader will be confused.

@annadata annadata assigned annadata and unassigned micheldavid May 11, 2023
@dinesh-crest dinesh-crest requested a review from annadata May 11, 2023 12:06
@pattishin
Copy link
Contributor

Hi @dinesh-crest! Do you mind taking a look at the conflicts in dlp/system-test/inspect.test.js?

@dinesh-crest dinesh-crest force-pushed the inspect_string_with_exclusion_dict branch from e3a40f7 to 8900d9b Compare May 22, 2023 05:29
Copy link

@annadata annadata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kweinmeister kweinmeister added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 24, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 24, 2023
@annadata annadata force-pushed the inspect_string_with_exclusion_dict branch from 68195f7 to 4faab26 Compare May 25, 2023 04:25
@annadata annadata added kokoro:force-run Add this label to force Kokoro to re-run the tests. actions:force-run labels May 25, 2023
@kokoro-team kokoro-team removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels May 25, 2023
@annadata annadata merged commit 44f841d into GoogleCloudPlatform:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dlp Issues related to the Sensitive Data Protection API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants