From 7258954ab4c207e2783b90e07a8e5c967e299494 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 5 May 2020 18:46:19 -0400 Subject: [PATCH] Update and add Cloud KMS samples [(#3690)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/3690) This updates the Cloud KMS samples to match the format from the other 6 languages. It also updates the samples to note the workaround for https://github.com/googleapis/gapic-generator-python/issues/364. --- kms/attestations/README.rst | 74 ++++++++++++++++++++++++++ kms/attestations/requirements-test.txt | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 kms/attestations/README.rst diff --git a/kms/attestations/README.rst b/kms/attestations/README.rst new file mode 100644 index 000000000000..dddddfbcd7d3 --- /dev/null +++ b/kms/attestations/README.rst @@ -0,0 +1,74 @@ +.. This file is automatically generated. Do not edit this file directly. + +Google Cloud Key Management Service Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/attestations/README.rst + + +This directory contains samples for Google Cloud Key Management Service. The `Cloud Key Management Service`_ allows you to create, import, and manage cryptographic keys and perform cryptographic operations in a single centralized cloud service. + + + + +.. _Google Cloud Key Management Service: https://cloud.google.com/kms/docs/ + +Setup +------------------------------------------------------------------------------- + + +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ + +Samples +------------------------------------------------------------------------------- + +Verify attestations for keys generated by Cloud HSM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/attestations/verify_attestation.py,kms/attestations/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python verify_attestation.py + + + + + + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/kms/attestations/requirements-test.txt b/kms/attestations/requirements-test.txt index 781d4326c947..d3e30fa6c737 100644 --- a/kms/attestations/requirements-test.txt +++ b/kms/attestations/requirements-test.txt @@ -1 +1 @@ -pytest==5.3.2 +pytest==5.4.1