@@ -133,22 +133,16 @@ section.
133
133
134
134
# # Connecting with Toolbox Client SDK
135
135
136
- You can connect to Toolbox Cloud Run instances directly through the SDK
136
+ You can connect to Toolbox Cloud Run instances directly through the SDK.
137
137
138
138
1. [Set up ` Cloud Run Invoker` role
139
139
access](https://cloud.google.com/run/docs/securing/managing-access#service-add-principals)
140
140
to your Cloud Run service.
141
141
142
- 1. Set up [Application Default
142
+ 1. (Only for local runs) Set up [Application Default
143
143
Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment)
144
144
for the principle you set up the ` Cloud Run Invoker` role access to.
145
145
146
- {{< notice tip > }}
147
- If you' re working in some other environment than local, set up [environment
148
- specific Default
149
- Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).
150
- {{< /notice >}}
151
-
152
146
1. Run the following to retrieve a non-deterministic URL for the cloud run service:
153
147
154
148
` ` ` bash
@@ -160,9 +154,11 @@ You can connect to Toolbox Cloud Run instances directly through the SDK
160
154
` ` ` python
161
155
from toolbox_core import ToolboxClient, auth_methods
162
156
163
- auth_token_provider = auth_methods.aget_google_id_token # can also use sync method
164
-
165
157
# Replace with the Cloud Run service URL generated in the previous step.
158
+ URL = " https://cloud-run-url.app"
159
+
160
+ auth_token_provider = auth_methods.aget_google_id_token(URL) # can also use sync method
161
+
166
162
async with ToolboxClient(
167
163
URL,
168
164
client_headers={"Authorization": auth_token_provider},
0 commit comments