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

move google-cloud/dlp to peer dependency #25

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
17 changes: 8 additions & 9 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: install
uses: actions/[email protected]
with:
args: ci
- name: verify_all
uses: actions/[email protected]
with:
args: run verify_all
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node: '10.x'
- name: install
run: npm install
- name: verify_all
run: npm run verify_all
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Note that Google Cloud DLP already also provides a node.js library (https://www.
- it is easy to add custom patterns or rules to redact-pii
- `GoogleDLPRedactor` uses the `.inspectContent` instead of `.deidentifyContent` method of `@google-cloud/dlp` which has a pricing advantage for large scale redaction scenarios since you will be only charged "Inspection Units" and no additional "Transformation Units" (see https://cloud.google.com/dlp/pricing) . redact-pii only uses DLP to `identify` PII but does the replacement `transformation` by itself which saves you some 💰💰💰.

In order to use Google Data Loss Prevention you must install the peer dependency yourself with `npm install --save @google-cloud/dlp` since we are no longer bundling it with this package.

#### Use Google Data Loss Prevention only (this won't make use of redact-pii's built-in regex patterns)

1. Prequesites:
Expand All @@ -180,7 +182,7 @@ Note that Google Cloud DLP already also provides a node.js library (https://www.
3. Use redact pii

```js
const { GoogleDLPRedactor } = require('redact-pii');
const { GoogleDLPRedactor } = require('redact-pii/lib/custom/GoogleDLPRedactor');

const redactor = new GoogleDLPRedactor();

Expand All @@ -196,7 +198,8 @@ You can create an `AsyncRedactor` and add a `GoogleDLPRedactor` as custom redact
That way you are combining redact-pii's built-in patterns with Google DLP. The example below additionally adds a custom regexp pattern.

```js
const { AsyncRedactor, GoogleDLPRedactor } = require('redact-pii');
const { AsyncRedactor } = require('redact-pii');
const { GoogleDLPRedactor } = require('redact-pii/lib/custom/GoogleDLPRedactor');

const redactor = new AsyncRedactor({
customRedactors: {
Expand Down
Loading