Skip to content

Commit

Permalink
update docs for Google Cloud DLP
Browse files Browse the repository at this point in the history
  • Loading branch information
Torgny Bjers committed May 15, 2019
1 parent 8a46573 commit 8c175ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ In order to use Google Data Loss Prevention you must install the peer dependency
3. Use redact pii

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

const redactor = new GoogleDLPRedactor();

Expand All @@ -198,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
2 changes: 1 addition & 1 deletion src/custom/GoogleDLPRedactor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IAsyncRedactor } from '../types';
import DLP from '@google-cloud/dlp';

const minLikelihood = 'LIKELIHOOD_UNSPECIFIED';
const maxFindings = 0;
Expand Down Expand Up @@ -129,7 +130,6 @@ export class GoogleDLPRedactor implements IAsyncRedactor {
}

async setup(): Promise<any> {
const DLP = await import('@google-cloud/dlp');
this.dlpClient = new DLP.DlpServiceClient(this.opts.clientOptions);
}

Expand Down

0 comments on commit 8c175ff

Please sign in to comment.