Skip to content

Commit

Permalink
feat: add synth script and regenerate (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Jun 26, 2018
1 parent 1a382cd commit 613c469
Show file tree
Hide file tree
Showing 9 changed files with 1,140 additions and 304 deletions.
489 changes: 330 additions & 159 deletions packages/google-privacy-dlp/package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions packages/google-privacy-dlp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@
"test": "npm run cover"
},
"dependencies": {
"google-gax": "^0.16.0",
"google-gax": "^0.17.1",
"lodash.merge": "^4.6.0",
"protobufjs": "^6.8.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^2.3.0",
"async": "^2.5.0",
"codecov": "^3.0.0",
"eslint": "^5.0.0",
"eslint-config-prettier": "^2.6.0",
Expand All @@ -71,7 +70,6 @@
"mocha": "^5.0.0",
"nyc": "^12.0.2",
"power-assert": "^1.4.4",
"prettier": "^1.7.4",
"through2": "^2.0.3"
"prettier": "^1.7.4"
}
}
315 changes: 270 additions & 45 deletions packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ option php_namespace = "Google\\Cloud\\Dlp\\V2";

// Type of information detected by the API.
message InfoType {
// Name of the information type.
// Name of the information type. Either a name of your choosing when
// creating a CustomInfoType, or one of the names listed
// at https://cloud.google.com/dlp/docs/infotypes-reference when specifying
// a built-in type.
string name = 1;
}

Expand Down Expand Up @@ -86,13 +89,13 @@ message CustomInfoType {
// These types of transformations are
// those that perform pseudonymization, thereby producing a "surrogate" as
// output. This should be used in conjunction with a field on the
// transformation such as `surrogate_info_type`. This custom info type does
// transformation such as `surrogate_info_type`. This CustomInfoType does
// not support the use of `detection_rules`.
message SurrogateType {

}

// Rule for modifying a custom info type to alter behavior under certain
// Rule for modifying a CustomInfoType to alter behavior under certain
// circumstances, depending on the specific details of the rule. Not supported
// for the `surrogate_type` custom info type.
message DetectionRule {
Expand Down Expand Up @@ -125,10 +128,10 @@ message CustomInfoType {
}
}

// Detection rule that adjusts the likelihood of findings within a certain
// The rule that adjusts the likelihood of findings within a certain
// proximity of hotwords.
message HotwordRule {
// Regex pattern defining what qualifies as a hotword.
// Regular expression pattern defining what qualifies as a hotword.
Regex hotword_regex = 1;

// Proximity of the finding within which the entire hotword must reside.
Expand All @@ -151,29 +154,30 @@ message CustomInfoType {
}
}

// Info type configuration. All custom info types must have configurations
// that do not conflict with built-in info types or other custom info types.
// All CustomInfoTypes must have a name
// that does not conflict with built-in InfoTypes or other CustomInfoTypes.
InfoType info_type = 1;

// Likelihood to return for this custom info type. This base value can be
// Likelihood to return for this CustomInfoType. This base value can be
// altered by a detection rule if the finding meets the criteria specified by
// the rule. Defaults to `VERY_LIKELY` if not specified.
Likelihood likelihood = 6;

oneof type {
// Dictionary-based custom info type.
// A list of phrases to detect as a CustomInfoType.
Dictionary dictionary = 2;

// Regex-based custom info type.
// Regular expression based CustomInfoType.
Regex regex = 3;

// Surrogate info type.
// Message for detecting output from deidentification transformations that
// support reversing.
SurrogateType surrogate_type = 4;
}

// Set of detection rules to apply to all findings of this custom info type.
// Set of detection rules to apply to all findings of this CustomInfoType.
// Rules are applied in order that they are specified. Not supported for the
// `surrogate_type` custom info type.
// `surrogate_type` CustomInfoType.
repeated DetectionRule detection_rules = 7;
}

Expand Down Expand Up @@ -223,6 +227,20 @@ message CloudStorageOptions {
string url = 1;
}

// How to sample bytes if not all bytes are scanned. Meaningful only when used
// in conjunction with bytes_limit_per_file. If not specified, scanning would
// start from the top.
enum SampleMethod {
SAMPLE_METHOD_UNSPECIFIED = 0;

// Scan from the top (default).
TOP = 1;

// For each file larger than bytes_limit_per_file, randomly pick the offset
// to start scanning. The scanned bytes are contiguous.
RANDOM_START = 2;
}

FileSet file_set = 1;

// Max number of bytes to scan from a file. If a scanned file's size is bigger
Expand All @@ -233,9 +251,16 @@ message CloudStorageOptions {
// If empty, all files are scanned and available data format processors
// are applied.
repeated FileType file_types = 5;

SampleMethod sample_method = 6;

// Limits the number of files to scan to this percentage of the input FileSet.
// Number of files scanned is rounded down. Must be between 0 and 100,
// inclusively. Both 0 and 100 means no limit. Defaults to 0.
int32 files_limit_percent = 7;
}

// Message representing a path in Cloud Storage.
// Message representing a single file or path in Cloud Storage.
message CloudStoragePath {
// A url representing a file or path (no wildcards) in Cloud Storage.
// Example: gs://[BUCKET_NAME]/dictionary.txt
Expand All @@ -244,6 +269,19 @@ message CloudStoragePath {

// Options defining BigQuery table and row identifiers.
message BigQueryOptions {
// How to sample rows if not all rows are scanned. Meaningful only when used
// in conjunction with rows_limit. If not specified, scanning would start
// from the top.
enum SampleMethod {
SAMPLE_METHOD_UNSPECIFIED = 0;

// Scan from the top (default).
TOP = 1;

// Randomly pick the row to start scanning. The scanned rows are contiguous.
RANDOM_START = 2;
}

// Complete BigQuery table reference.
BigQueryTable table_reference = 1;

Expand All @@ -255,6 +293,8 @@ message BigQueryOptions {
// rest of the rows are omitted. If not set, or if set to 0, all rows will be
// scanned. Cannot be used in conjunction with TimespanConfig.
int64 rows_limit = 3;

SampleMethod sample_method = 4;
}

// Shared message indicating Cloud storage type.
Expand Down Expand Up @@ -402,7 +442,7 @@ message EntityId {
// Categorization of results based on how likely they are to represent a match,
// based on the number of elements they contain which imply a match.
enum Likelihood {
// Default value; information with all likelihoods is included.
// Default value; same as POSSIBLE.
LIKELIHOOD_UNSPECIFIED = 0;

// Few matching elements.
Expand Down
4 changes: 2 additions & 2 deletions packages/google-privacy-dlp/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Loading

0 comments on commit 613c469

Please sign in to comment.