aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/googleapis/google/privacy/dlp/v2beta1/storage.proto
blob: 792f914b0be534b6c4cecb378e7c233ff3587751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// Copyright 2017 Google Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.privacy.dlp.v2beta1;

import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2beta1;dlp";
option java_multiple_files = true;
option java_outer_classname = "DlpStorage";
option java_package = "com.google.privacy.dlp.v2beta1";


// Type of information detected by the API.
message InfoType {
  // Name of the information type, provided by the API call ListInfoTypes.
  string name = 1;
}

// General identifier of a data field in a storage service.
message FieldId {
  // Column name describing the field.
  string column_name = 1;
}

// Datastore partition ID.
// A partition ID identifies a grouping of entities. The grouping is always
// by project and namespace, however the namespace ID may be empty.
//
// A partition ID contains several dimensions:
// project ID and namespace ID.
message PartitionId {
  // The ID of the project to which the entities belong.
  string project_id = 2;

  // If not empty, the ID of the namespace to which the entities belong.
  string namespace_id = 4;
}

// A representation of a Datastore kind.
message KindExpression {
  // The name of the kind.
  string name = 1;
}

// A reference to a property relative to the Datastore kind expressions.
message PropertyReference {
  // The name of the property.
  // If name includes "."s, it may be interpreted as a property name path.
  string name = 2;
}

// A representation of a Datastore property in a projection.
message Projection {
  // The property to project.
  PropertyReference property = 1;
}

// Options defining a data set within Google Cloud Datastore.
message DatastoreOptions {
  // A partition ID identifies a grouping of entities. The grouping is always
  // by project and namespace, however the namespace ID may be empty.
  PartitionId partition_id = 1;

  // The kind to process.
  KindExpression kind = 2;

  // Properties to scan. If none are specified, all properties will be scanned
  // by default.
  repeated Projection projection = 3;
}

// Options defining a file or a set of files (path ending with *) within
// a Google Cloud Storage bucket.
message CloudStorageOptions {
  // Set of files to scan.
  message FileSet {
    // The url, in the format gs://<bucket>/<path>. Trailing wildcard in the
    // path is allowed.
    string url = 1;
  }

  FileSet file_set = 1;
}

// A location in Cloud Storage.
message CloudStoragePath {
  // The url, in the format of gs://bucket/<path>.
  string path = 1;
}

// Shared message indicating Cloud storage type.
message StorageConfig {
  oneof type {
    // Google Cloud Datastore options specification.
    DatastoreOptions datastore_options = 2;

    // Google Cloud Storage options specification.
    CloudStorageOptions cloud_storage_options = 3;
  }
}

// Record key for a finding in a Cloud Storage file.
message CloudStorageKey {
  // Path to the file.
  string file_path = 1;

  // Byte offset of the referenced data in the file.
  int64 start_offset = 2;
}

// Record key for a finding in Cloud Datastore.
message DatastoreKey {
  // Datastore entity key.
  Key entity_key = 1;
}

// A unique identifier for a Datastore entity.
// If a key's partition ID or any of its path kinds or names are
// reserved/read-only, the key is reserved/read-only.
// A reserved/read-only key is forbidden in certain documented contexts.
message Key {
  // A (kind, ID/name) pair used to construct a key path.
  //
  // If either name or ID is set, the element is complete.
  // If neither is set, the element is incomplete.
  message PathElement {
    // The kind of the entity.
    // A kind matching regex `__.*__` is reserved/read-only.
    // A kind must not contain more than 1500 bytes when UTF-8 encoded.
    // Cannot be `""`.
    string kind = 1;

    // The type of ID.
    oneof id_type {
      // The auto-allocated ID of the entity.
      // Never equal to zero. Values less than zero are discouraged and may not
      // be supported in the future.
      int64 id = 2;

      // The name of the entity.
      // A name matching regex `__.*__` is reserved/read-only.
      // A name must not be more than 1500 bytes when UTF-8 encoded.
      // Cannot be `""`.
      string name = 3;
    }
  }

  // Entities are partitioned into subsets, currently identified by a project
  // ID and namespace ID.
  // Queries are scoped to a single partition.
  PartitionId partition_id = 1;

  // The entity path.
  // An entity path consists of one or more elements composed of a kind and a
  // string or numerical identifier, which identify entities. The first
  // element identifies a _root entity_, the second element identifies
  // a _child_ of the root entity, the third element identifies a child of the
  // second entity, and so forth. The entities identified by all prefixes of
  // the path are called the element's _ancestors_.
  //
  // A path can never be empty, and a path can have at most 100 elements.
  repeated PathElement path = 2;
}

// Message for a unique key indicating a record that contains a finding.
message RecordKey {
  oneof type {
    CloudStorageKey cloud_storage_key = 1;

    DatastoreKey datastore_key = 2;
  }
}