Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KMS: Make the encrypt/decrypt samples consistent with the other languages #1075

Merged
merged 1 commit into from
Aug 17, 2017
Merged

KMS: Make the encrypt/decrypt samples consistent with the other languages #1075

merged 1 commit into from
Aug 17, 2017

Conversation

russ-
Copy link

@russ- russ- commented Aug 16, 2017

In particular, this change:

  • changes to use a consistent "_id" suffix for resource name components
  • uses "data" instead of "text", since encryption is not restricted to text
  • substitutes "ciphertext" for "encrypted {text, data}"
  • cases "cryptoKey" and "keyRing" consistently with the API

Tracking bug: http://b/64758639

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 16, 2017
cryptokeys = kms_client.projects().locations().keyRings().cryptoKeys()
request = cryptokeys.encrypt(
# Use the KMS API to encrypt the data.
cryptoKeys = kms_client.projects().locations().keyRings().cryptoKeys()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our Python style guide is lower snake case for variable names. I understand the desire to match the API, but we've stuck to using lower snake case consistency for variables regardless of the API.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Sorry, I didn't intend to go against the style guide, just an oversight on my part.

"""Encrypts data from a plaintext_file_name using the provided CryptoKey
and saves it to an encrypted_file_name so it can only be recovered with a
call to decrypt."""
def encrypt(project_id, location_id, key_ring_id, crypto_key_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are changing variable names, can you update the other samples in this file to match?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
@theacodes theacodes merged commit a8763bf into GoogleCloudPlatform:master Aug 17, 2017
busunkim96 pushed a commit to googleapis/python-kms that referenced this pull request Jun 4, 2020
…oogleCloudPlatform/python-docs-samples#1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
rsamborski pushed a commit that referenced this pull request Nov 8, 2022
…1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
rsamborski pushed a commit that referenced this pull request Nov 8, 2022
…1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
rsamborski pushed a commit that referenced this pull request Nov 11, 2022
…1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
rsamborski pushed a commit that referenced this pull request Nov 14, 2022
…1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
dandhlee pushed a commit that referenced this pull request Nov 14, 2022
…1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Oct 21, 2023
…oogleCloudPlatform/python-docs-samples#1075)

In particular, this change:
- changes to use a consistent "_id" suffix for resource name components
- uses "data" instead of "text", since encryption is not restricted to text
- substitutes "ciphertext" for "encrypted {text, data}"
- spells "crypto key" and "key ring" each as two separate words, as in the API

Tracking bug: http://b/64758639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants