Skip to content

Commit 5b806f1

Browse files
authored
docs(toolbox-core): fix readme (#268)
* docs(toolbox-core): fix readme * wrap lines
1 parent 23379fb commit 5b806f1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

packages/toolbox-core/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,22 +269,31 @@ connecting to a Toolbox server instance that requires authentication. This is
269269
crucial for securing your Toolbox server endpoint, especially when deployed on
270270
platforms like Cloud Run, GKE, or any environment where unauthenticated access is restricted.
271271

272-
This client-to-server authentication ensures that the Toolbox server can verify the identity of the client making the request before any tool is loaded or called. It is different from [Authenticating Tools](#authenticating-tools), which deals with providing credentials for specific tools within an already connected Toolbox session.
272+
This client-to-server authentication ensures that the Toolbox server can verify
273+
the identity of the client making the request before any tool is loaded or
274+
called. It is different from [Authenticating Tools](#authenticating-tools),
275+
which deals with providing credentials for specific tools within an already
276+
connected Toolbox session.
273277

274278
### When is Client-to-Server Authentication Needed?
275279

276-
You'll need this type of authentication if your Toolbox server is configured to deny unauthenticated requests. For example:
280+
You'll need this type of authentication if your Toolbox server is configured to
281+
deny unauthenticated requests. For example:
277282

278283
- Your Toolbox server is deployed on Cloud Run and configured to "Require authentication."
279-
- Your server is behind an Identity-Aware Proxy (IAP) or a similar authentication layer.
284+
- Your server is behind an Identity-Aware Proxy (IAP) or a similar
285+
authentication layer.
280286
- You have custom authentication middleware on your self-hosted Toolbox server.
281287

282288
Without proper client authentication in these scenarios, attempts to connect or
283289
make calls (like `load_tool`) will likely fail with `Unauthorized` errors.
284290

285291
### How it works
286292

287-
The `ToolboxClient` (and `ToolboxSyncClient`) allows you to specify functions (or coroutines for the async client) that dynamically generate HTTP headers for every request sent to the Toolbox server. The most common use case is to add an Authorization header with a bearer token (e.g., a Google ID token).
293+
The `ToolboxClient` (and `ToolboxSyncClient`) allows you to specify functions
294+
(or coroutines for the async client) that dynamically generate HTTP headers for
295+
every request sent to the Toolbox server. The most common use case is to add an
296+
Authorization header with a bearer token (e.g., a Google ID token).
288297

289298
These header-generating functions are called just before each request, ensuring
290299
that fresh credentials or header values can be used.
@@ -298,7 +307,7 @@ You can configure these dynamic headers in two ways:
298307
```python
299308
from toolbox_core import ToolboxClient
300309

301-
async with ToolboxClient("toolbox-url", headers={"header1": header1_getter, "header2": header2_getter, ...}) as client:
310+
async with ToolboxClient("toolbox-url", client_headers={"header1": header1_getter, "header2": header2_getter, ...}) as client:
302311
```
303312

304313
1. **After Client Initialization**

0 commit comments

Comments
 (0)