diff --git a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/__init__.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/__init__.py index 71c2343..2336e03 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/__init__.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/__init__.py @@ -30,7 +30,6 @@ _transport_registry["grpc"] = SecretManagerServiceGrpcTransport _transport_registry["grpc_asyncio"] = SecretManagerServiceGrpcAsyncIOTransport - __all__ = ( "SecretManagerServiceTransport", "SecretManagerServiceGrpcTransport", diff --git a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py index 979cf79..616cbe9 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py @@ -156,6 +156,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -174,6 +178,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._stubs = {} # type: Dict[str, Callable] @@ -200,7 +208,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optionsl[str]): The host for the channel to use. + address (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If diff --git a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py index 1eb2146..14d7021 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py @@ -201,6 +201,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -219,6 +223,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) # Run the base constructor. diff --git a/google/cloud/secretmanager_v1/types/__init__.py b/google/cloud/secretmanager_v1/types/__init__.py index 3a0ef41..3fe1200 100644 --- a/google/cloud/secretmanager_v1/types/__init__.py +++ b/google/cloud/secretmanager_v1/types/__init__.py @@ -42,7 +42,6 @@ DestroySecretVersionRequest, ) - __all__ = ( "Secret", "SecretVersion", diff --git a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/__init__.py b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/__init__.py index 71c2343..2336e03 100644 --- a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/__init__.py +++ b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/__init__.py @@ -30,7 +30,6 @@ _transport_registry["grpc"] = SecretManagerServiceGrpcTransport _transport_registry["grpc_asyncio"] = SecretManagerServiceGrpcAsyncIOTransport - __all__ = ( "SecretManagerServiceTransport", "SecretManagerServiceGrpcTransport", diff --git a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc.py b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc.py index bbcd5ca..e8ff977 100644 --- a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc.py +++ b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc.py @@ -156,6 +156,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -174,6 +178,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._stubs = {} # type: Dict[str, Callable] @@ -200,7 +208,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optionsl[str]): The host for the channel to use. + address (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If diff --git a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc_asyncio.py b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc_asyncio.py index e25484f..c9a76ec 100644 --- a/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc_asyncio.py +++ b/google/cloud/secretmanager_v1beta1/services/secret_manager_service/transports/grpc_asyncio.py @@ -201,6 +201,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -219,6 +223,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) # Run the base constructor. diff --git a/google/cloud/secretmanager_v1beta1/types/__init__.py b/google/cloud/secretmanager_v1beta1/types/__init__.py index e26ca04..c287f6d 100644 --- a/google/cloud/secretmanager_v1beta1/types/__init__.py +++ b/google/cloud/secretmanager_v1beta1/types/__init__.py @@ -39,7 +39,6 @@ DestroySecretVersionRequest, ) - __all__ = ( "Secret", "SecretVersion", diff --git a/samples/snippets/README.rst b/samples/snippets/README.rst deleted file mode 100644 index 141855b..0000000 --- a/samples/snippets/README.rst +++ /dev/null @@ -1,508 +0,0 @@ - -.. This file is automatically generated. Do not edit this file directly. - -Google Secret Manager 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=secretmanager/api-client/README.rst - - -This directory contains samples for Google Secret Manager. `Google Secret Manager` is a service that allows you to store, manage, and secure access to application secrets. - - - - -.. _Google Secret Manager: https://cloud.google.com/secret-manager - - -Setup -------------------------------------------------------------------------------- - - - -Authentication -++++++++++++++ - -This sample requires you to have authentication setup. Refer to the -`Authentication Getting Started Guide`_ for instructions on setting up -credentials for applications. - -.. _Authentication Getting Started Guide: - https://cloud.google.com/docs/authentication/getting-started - - - - -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 3.6+. - - .. 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 -------------------------------------------------------------------------------- - - -Quickstart -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/quickstart.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python quickstart.py - - - - -Access Secret Version -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/access_secret_version.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python access_secret_version.py - - - usage: access_secret_version.py [-h] project_id secret_id version_id - - command line application and sample code for accessing a secret version. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to access - version_id version to access - - optional arguments: - -h, --help show this help message and exit - - - - - -Add Secret Version -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/add_secret_version.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python add_secret_version.py - - - usage: add_secret_version.py [-h] project_id secret_id payload - - command line application and sample code for adding a secret version with the - specified payload to an existing secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret in which to add - payload secret material payload - - optional arguments: - -h, --help show this help message and exit - - - - - -Create Secret -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/create_secret.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python create_secret.py - - - usage: create_secret.py [-h] project_id secret_id - - command line application and sample code for creating a new secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to create - - optional arguments: - -h, --help show this help message and exit - - - - - -Delete Secret -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/delete_secret.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python delete_secret.py - - - usage: delete_secret.py [-h] project_id secret_id - - command line application and sample code for deleting an existing secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to delete - - optional arguments: - -h, --help show this help message and exit - - - - - -Destroy Secret Version -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/destroy_secret_version.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python destroy_secret_version.py - - - usage: destroy_secret_version.py [-h] project_id secret_id version_id - - command line application and sample code for destroying a secret verison. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret from which to act - version_id id of the version to destroy - - optional arguments: - -h, --help show this help message and exit - - - - - -Enable Secret Version -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/enable_secret_version.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python enable_secret_version.py - - - usage: enable_secret_version.py [-h] project_id secret_id version_id - - command line application and sample code for enabling a secret version. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret from which to act - version_id id of the version to enable - - optional arguments: - -h, --help show this help message and exit - - - - - -Get Secret Version -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/get_secret_version.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python get_secret_version.py - - - usage: get_secret_version.py [-h] project_id secret_id version_id - - command line application and sample code for getting metdata about a secret - version, but not the secret payload. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret from which to act - version_id id of the version to get - - optional arguments: - -h, --help show this help message and exit - - - - - -IAM Grant Access -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/iam_grant_access.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python iam_grant_access.py - - - usage: iam_grant_access.py [-h] project_id secret_id member - - command line application and sample code for granting access to a secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to get - member member to grant access - - optional arguments: - -h, --help show this help message and exit - - - - - -IAM Revoke Access -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/iam_revoke_access.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python iam_revoke_access.py - - - usage: iam_revoke_access.py [-h] project_id secret_id member - - command line application and sample code for revoking access to a secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to get - member member to revoke access - - optional arguments: - -h, --help show this help message and exit - - - - - -Get Secret -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/get_secret.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python get_secret.py - - - usage: get_secret.py [-h] project_id secret_id - - command line application and sample code for getting metadata about a secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret to get - - optional arguments: - -h, --help show this help message and exit - - - - - -List Secret Versions -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/list_secret_versions.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python list_secret_versions.py - - - usage: list_secret_versions.py [-h] project_id secret_id - - command line application and sample code for listing secret versions of a - secret. - - positional arguments: - project_id id of the GCP project - secret_id id of the secret in which to list - - optional arguments: - -h, --help show this help message and exit - - - - - -List Secrets -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/list_secrets.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python list_secrets.py - - - usage: list_secrets.py [-h] project_id - - command line application and sample code for listing secrets in a project. - - positional arguments: - project_id id of the GCP project - - optional arguments: - -h, --help show this help message and exit - - - - - -Update Secret -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=secretmanager/api-client/update_secret.py,secretmanager/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python update_secret.py - - - usage: update_secret.py [-h] --secret-id SECRET_ID project_id - - positional arguments: - project_id id of the GCP project - - optional arguments: - -h, --help show this help message and exit - --secret-id SECRET_ID - - - - - - - - - -.. _Google Cloud SDK: https://cloud.google.com/sdk/ diff --git a/synth.metadata b/synth.metadata index f73938e..f7d45d0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-secret-manager.git", - "sha": "8d02b18a31fa4b878cf9608aed8814d437d753dc" + "sha": "fafd37588c8509efd926d8d7529965ac4246fbb4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dabe30b45bc86fdaf4126f26cbcfd73babbfa3fe", - "internalRef": "345194337" + "sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907", + "internalRef": "347055288" } }, { @@ -143,7 +143,6 @@ "renovate.json", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", - "samples/snippets/README.rst", "samples/snippets/noxfile.py", "scripts/decrypt-secrets.sh", "scripts/fixup_secretmanager_v1_keywords.py", diff --git a/tests/unit/gapic/secretmanager_v1/test_secret_manager_service.py b/tests/unit/gapic/secretmanager_v1/test_secret_manager_service.py index 2713693..a97340c 100644 --- a/tests/unit/gapic/secretmanager_v1/test_secret_manager_service.py +++ b/tests/unit/gapic/secretmanager_v1/test_secret_manager_service.py @@ -3974,6 +3974,10 @@ def test_secret_manager_service_transport_channel_mtls_with_client_cert_source( scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel assert transport._ssl_channel_credentials == mock_ssl_cred @@ -4015,6 +4019,10 @@ def test_secret_manager_service_transport_channel_mtls_with_adc(transport_class) scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel diff --git a/tests/unit/gapic/secretmanager_v1beta1/test_secret_manager_service.py b/tests/unit/gapic/secretmanager_v1beta1/test_secret_manager_service.py index b648685..7975256 100644 --- a/tests/unit/gapic/secretmanager_v1beta1/test_secret_manager_service.py +++ b/tests/unit/gapic/secretmanager_v1beta1/test_secret_manager_service.py @@ -3976,6 +3976,10 @@ def test_secret_manager_service_transport_channel_mtls_with_client_cert_source( scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel assert transport._ssl_channel_credentials == mock_ssl_cred @@ -4017,6 +4021,10 @@ def test_secret_manager_service_transport_channel_mtls_with_adc(transport_class) scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel