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

docs(dlp-samples): modified region tags and fixed comment #330

Merged
merged 2 commits into from
Feb 17, 2022
Merged
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
15 changes: 8 additions & 7 deletions samples/snippets/deid.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,18 +473,19 @@ def reidentify_with_fpe(
def reidentify_with_deterministic(
catherinerosesantos marked this conversation as resolved.
Show resolved Hide resolved
project, input_str, surrogate_type=None, key_name=None, wrapped_key=None,
):
"""Deidentifies sensitive data in a string using deterministic encryption.
"""Re-identifies content that was previously de-identified through deterministic encryption.
Args:
project: The Google Cloud project id to use as a parent resource.
input_str: The string to deidentify (will be treated as text).
surrogate_type: The name of the surrogate custom info type to used
project: The Google Cloud project ID to use as a parent resource.
input_str: The string to be re-identified. Provide the entire token. Example:
EMAIL_ADDRESS_TOKEN(52):AVAx2eIEnIQP5jbNEr2j9wLOAd5m4kpSBR/0jjjGdAOmryzZbE/q
surrogate_type: The name of the surrogate custom infoType used
during the encryption process.
key_name: The name of the Cloud KMS key used to encrypt ('wrap') the
key_name: The name of the Cloud KMS key used to encrypt ("wrap") the
AES-256 key. Example:
keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/
keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME'
wrapped_key: The encrypted ('wrapped') AES-256 key to use. This key
should be encrypted using the Cloud KMS key specified by key_name.
wrapped_key: The encrypted ("wrapped") AES-256 key previously used to encrypt the content.
This key must have been encrypted using the Cloud KMS key specified by key_name.
Returns:
None; the response from the API is printed to the terminal.
"""
Expand Down
8 changes: 4 additions & 4 deletions samples/snippets/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os


# [START dlp_create_template]
# [START dlp_create_inspect_template]
def create_inspect_template(
project,
info_types,
Expand Down Expand Up @@ -87,7 +87,7 @@ def create_inspect_template(
print("Successfully created template {}".format(response.name))


# [END dlp_create_template]
# [END dlp_create_inspect_template]


# [START dlp_list_templates]
Expand Down Expand Up @@ -134,7 +134,7 @@ def list_inspect_templates(project):
# [END dlp_list_templates]


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


# [END dlp_delete_template]
# [END dlp_delete_inspect_template]


if __name__ == "__main__":
Expand Down