| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -146,7 +146,7 @@ def secure_authorized_channel( | |||
| 146 | 146 | regular_ssl_credentials = grpc.ssl_channel_credentials() | |
| 147 | 147 | ||
| 148 | 148 | channel = google.auth.transport.grpc.secure_authorized_channel( | |
| 149 | - credentials, regular_endpoint, request, | ||
| 149 | + credentials, request, regular_endpoint, | ||
| 150 | 150 | ssl_credentials=regular_ssl_credentials) | |
| 151 | 151 | ||
| 152 | 152 | Option 2: create a mutual TLS channel by calling a callback which returns | |
@@ -162,7 +162,7 @@ def my_client_cert_callback(): | |||
| 162 | 162 | ||
| 163 | 163 | try: | |
| 164 | 164 | channel = google.auth.transport.grpc.secure_authorized_channel( | |
| 165 | - credentials, mtls_endpoint, request, | ||
| 165 | + credentials, request, mtls_endpoint, | ||
| 166 | 166 | client_cert_callback=my_client_cert_callback) | |
| 167 | 167 | except MyClientCertFailureException: | |
| 168 | 168 | # handle the exception | |
@@ -186,7 +186,7 @@ def my_client_cert_callback(): | |||
| 186 | 186 | else: | |
| 187 | 187 | endpoint_to_use = regular_endpoint | |
| 188 | 188 | channel = google.auth.transport.grpc.secure_authorized_channel( | |
| 189 | - credentials, endpoint_to_use, request, | ||
| 189 | + credentials, request, endpoint_to_use, | ||
| 190 | 190 | ssl_credentials=default_ssl_credentials) | |
| 191 | 191 | ||
| 192 | 192 | Option 4: not setting ssl_credentials and client_cert_callback. For devices | |
@@ -200,14 +200,14 @@ def my_client_cert_callback(): | |||
| 200 | 200 | certificate and key:: | |
| 201 | 201 | ||
| 202 | 202 | channel = google.auth.transport.grpc.secure_authorized_channel( | |
| 203 | - credentials, regular_endpoint, request) | ||
| 203 | + credentials, request, regular_endpoint) | ||
| 204 | 204 | ||
| 205 | 205 | The following code uses mtls_endpoint, if the created channle is regular, | |
| 206 | 206 | and API mtls_endpoint is confgured to require client SSL credentials, API | |
| 207 | 207 | calls using this channel will be rejected:: | |
| 208 | 208 | ||
| 209 | 209 | channel = google.auth.transport.grpc.secure_authorized_channel( | |
| 210 | - credentials, mtls_endpoint, request) | ||
| 210 | + credentials, request, mtls_endpoint) | ||
| 211 | 211 | ||
| 212 | 212 | Args: | |
| 213 | 213 | credentials (google.auth.credentials.Credentials): The credentials to | |
| Back | FazBrowse Home | New Git URL |
0 commit comments