-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
KMS: Make the encrypt/decrypt samples consistent with the other languages #1075
Conversation
kms/api-client/snippets.py
Outdated
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
…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
…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
…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
…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
…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
…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
…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
In particular, this change:
Tracking bug: http://b/64758639