Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixup sample for list_hmac_keys #2404

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

Merged
merged 3 commits into from
Sep 17, 2019
Merged
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
13 changes: 6 additions & 7 deletions 13 storage/cloud-client/hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@ def list_keys(project_id):
hmac_keys = storage_client.list_hmac_keys(project_id=project_id)
print('HMAC Keys:')
for hmac_key in hmac_keys:
print('The HMAC key metadata is:')
print('Key ID: {}'.format(hmac_key.id))
print('Service Account Email: {}'.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

Email is missing from the other samples. I missed that metadata field in Ruby and saw it was missing here as well. Only additional ask I have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to the other samples. Let me know if you see anything else!

hmac_key.service_account_email))
print('Access ID: {}'.format(hmac_key.access_id))
print('Project ID: {}'.format(hmac_key.project))
print('State: {}'.format(hmac_key.state))
print('Created At: {}'.format(hmac_key.time_created))
print('Updated At: {}'.format(hmac_key.updated))
print('Etag: {}'.format(hmac_key.etag))
# [END storage_list_hmac_keys]
return hmac_keys

Expand All @@ -55,6 +50,7 @@ def create_key(project_id, service_account_email):
print('The base64 encoded secret is {}'.format(secret))
print('Do not miss that secret, there is no API to recover it.')
print('The HMAC key metadata is:')
print('Service Account Email: {}'.format(hmac_key.service_account_email))
print('Key ID: {}'.format(hmac_key.id))
print('Access ID: {}'.format(hmac_key.access_id))
print('Project ID: {}'.format(hmac_key.project))
Expand All @@ -78,6 +74,7 @@ def get_key(access_id, project_id):
access_id,
project_id=project_id)
print('The HMAC key metadata is:')
print('Service Account Email: {}'.format(hmac_key.service_account_email))
print('Key ID: {}'.format(hmac_key.id))
print('Access ID: {}'.format(hmac_key.access_id))
print('Project ID: {}'.format(hmac_key.project))
Expand All @@ -103,6 +100,7 @@ def activate_key(access_id, project_id):
hmac_key.state = 'ACTIVE'
hmac_key.update()
print('The HMAC key metadata is:')
print('Service Account Email: {}'.format(hmac_key.service_account_email))
print('Key ID: {}'.format(hmac_key.id))
print('Access ID: {}'.format(hmac_key.access_id))
print('Project ID: {}'.format(hmac_key.project))
Expand All @@ -129,6 +127,7 @@ def deactivate_key(access_id, project_id):
hmac_key.update()
print('The HMAC key is now inactive.')
print('The HMAC key metadata is:')
print('Service Account Email: {}'.format(hmac_key.service_account_email))
print('Key ID: {}'.format(hmac_key.id))
print('Access ID: {}'.format(hmac_key.access_id))
print('Project ID: {}'.format(hmac_key.project))
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.