Skip to content

Commit

Permalink
docs(dlp-samples): modified region tags and fixed comment (#330)
Browse files Browse the repository at this point in the history
* docs(dlp-samples): modified region tags and fixed comment

* lint fix
  • Loading branch information
Sita04 authored Feb 17, 2022
1 parent c27e11d commit 09707f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions packages/google-cloud-dlp/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(
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 packages/google-cloud-dlp/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

0 comments on commit 09707f5

Please sign in to comment.