Skip to content
This repository was archived by the owner on Dec 10, 2023. It is now read-only.

Commit 6375f90

Browse files
authored
docs(dlp-samples): modified region tags and fixed comment (#330)
* docs(dlp-samples): modified region tags and fixed comment * lint fix
1 parent 3192498 commit 6375f90

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

samples/snippets/deid.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,18 +473,19 @@ def reidentify_with_fpe(
473473
def reidentify_with_deterministic(
474474
project, input_str, surrogate_type=None, key_name=None, wrapped_key=None,
475475
):
476-
"""Deidentifies sensitive data in a string using deterministic encryption.
476+
"""Re-identifies content that was previously de-identified through deterministic encryption.
477477
Args:
478-
project: The Google Cloud project id to use as a parent resource.
479-
input_str: The string to deidentify (will be treated as text).
480-
surrogate_type: The name of the surrogate custom info type to used
478+
project: The Google Cloud project ID to use as a parent resource.
479+
input_str: The string to be re-identified. Provide the entire token. Example:
480+
EMAIL_ADDRESS_TOKEN(52):AVAx2eIEnIQP5jbNEr2j9wLOAd5m4kpSBR/0jjjGdAOmryzZbE/q
481+
surrogate_type: The name of the surrogate custom infoType used
481482
during the encryption process.
482-
key_name: The name of the Cloud KMS key used to encrypt ('wrap') the
483+
key_name: The name of the Cloud KMS key used to encrypt ("wrap") the
483484
AES-256 key. Example:
484485
keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/
485486
keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME'
486-
wrapped_key: The encrypted ('wrapped') AES-256 key to use. This key
487-
should be encrypted using the Cloud KMS key specified by key_name.
487+
wrapped_key: The encrypted ("wrapped") AES-256 key previously used to encrypt the content.
488+
This key must have been encrypted using the Cloud KMS key specified by key_name.
488489
Returns:
489490
None; the response from the API is printed to the terminal.
490491
"""

samples/snippets/templates.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import os
2121

2222

23-
# [START dlp_create_template]
23+
# [START dlp_create_inspect_template]
2424
def create_inspect_template(
2525
project,
2626
info_types,
@@ -87,7 +87,7 @@ def create_inspect_template(
8787
print("Successfully created template {}".format(response.name))
8888

8989

90-
# [END dlp_create_template]
90+
# [END dlp_create_inspect_template]
9191

9292

9393
# [START dlp_list_templates]
@@ -134,7 +134,7 @@ def list_inspect_templates(project):
134134
# [END dlp_list_templates]
135135

136136

137-
# [START dlp_delete_template]
137+
# [START dlp_delete_inspect_template]
138138
def delete_inspect_template(project, template_id):
139139
"""Deletes a Data Loss Prevention API template.
140140
Args:
@@ -162,7 +162,7 @@ def delete_inspect_template(project, template_id):
162162
print("Template {} successfully deleted.".format(template_resource))
163163

164164

165-
# [END dlp_delete_template]
165+
# [END dlp_delete_inspect_template]
166166

167167

168168
if __name__ == "__main__":

0 commit comments

Comments
 (0)