Skip to content

Commit 6fc219d

Browse files
authored
Merge pull request #9 from devonartis/fix/api-reference-accuracy
docs: fix api-reference.md accuracy (V1-V4)
2 parents 0822d0f + be4eb3a commit 6fc219d

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

docs/api-reference.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ AgentWritApp(
2020
client_id: str,
2121
client_secret: str,
2222
*,
23-
timeout: float = 30.0,
23+
timeout: float = 10.0,
24+
user_agent: str | None = None,
2425
)
2526
```
2627

@@ -31,7 +32,8 @@ Creates an app instance. Authentication is lazy — the SDK does not contact the
3132
| `broker_url` | `str` | required | Base URL of the AgentWrit broker (e.g., `http://localhost:8080`) |
3233
| `client_id` | `str` | required | Application identifier from broker registration |
3334
| `client_secret` | `str` | required | Application secret. Never logged, printed, or included in any SDK output. |
34-
| `timeout` | `float` | `30.0` | HTTP request timeout in seconds |
35+
| `timeout` | `float` | `10.0` | HTTP request timeout in seconds |
36+
| `user_agent` | `str \| None` | `None` | Custom User-Agent header. If `None`, uses the SDK default. |
3537

3638
### create_agent()
3739

@@ -89,6 +91,14 @@ Shortcut for `agentwrit.validate(app.broker_url, token)`.
8991

9092
**Returns:** `ValidateResult`
9193

94+
### close()
95+
96+
```python
97+
app.close() -> None
98+
```
99+
100+
Closes the underlying HTTP transport. Call this when you're done with the app to release connections.
101+
92102
---
93103

94104
## Agent
@@ -239,7 +249,7 @@ from agentwrit import AgentClaims
239249

240250
| Field | Type | Description |
241251
|-------|------|-------------|
242-
| `iss` | `str` | Issuer (always `"agentwrit"`) |
252+
| `iss` | `str` | Issuer — identifies the broker that issued the token |
243253
| `sub` | `str` | Subject — SPIFFE URI of the agent |
244254
| `aud` | `list[str]` | Audience (may be empty) |
245255
| `exp` | `int` | Expiration (Unix timestamp) |

src/agentwrit/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AgentClaims:
2828
The `sub` field is a SPIFFE URI, ensuring the agent is a first-class
2929
identity in the trust domain.
3030
"""
31-
iss: str # always "agentwrit"
31+
iss: str # broker-configured issuer
3232
sub: str # SPIFFE URI
3333
aud: list[str]
3434
exp: int # Unix timestamp

0 commit comments

Comments
 (0)