From 102ac0e3ddf7e776ae742571c7fcec00c51270a4 Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:31:01 -0700 Subject: [PATCH] fix: fix the document of secure_authorized_session --- google/auth/transport/grpc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google/auth/transport/grpc.py b/google/auth/transport/grpc.py index 9a817976d..e691abea0 100644 --- a/google/auth/transport/grpc.py +++ b/google/auth/transport/grpc.py @@ -148,7 +148,7 @@ def secure_authorized_channel( regular_ssl_credentials = grpc.ssl_channel_credentials() channel = google.auth.transport.grpc.secure_authorized_channel( - credentials, regular_endpoint, request, + credentials, request, regular_endpoint, ssl_credentials=regular_ssl_credentials) Option 2: create a mutual TLS channel by calling a callback which returns @@ -188,7 +188,7 @@ def my_client_cert_callback(): else: endpoint_to_use = regular_endpoint channel = google.auth.transport.grpc.secure_authorized_channel( - credentials, endpoint_to_use, request, + credentials, request, endpoint_to_use, ssl_credentials=default_ssl_credentials) Option 4: not setting ssl_credentials and client_cert_callback. For devices @@ -202,14 +202,14 @@ def my_client_cert_callback(): certificate and key:: channel = google.auth.transport.grpc.secure_authorized_channel( - credentials, regular_endpoint, request) + credentials, request, regular_endpoint) The following code uses mtls_endpoint, if the created channle is regular, and API mtls_endpoint is confgured to require client SSL credentials, API calls using this channel will be rejected:: channel = google.auth.transport.grpc.secure_authorized_channel( - credentials, mtls_endpoint, request) + credentials, request, mtls_endpoint) Args: credentials (google.auth.credentials.Credentials): The credentials to