Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ AgentWritApp(
client_id: str,
client_secret: str,
*,
timeout: float = 30.0,
timeout: float = 10.0,
user_agent: str | None = None,
)
```

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

### create_agent()

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

**Returns:** `ValidateResult`

### close()

```python
app.close() -> None
```

Closes the underlying HTTP transport. Call this when you're done with the app to release connections.

---

## Agent
Expand Down Expand Up @@ -239,7 +249,7 @@ from agentwrit import AgentClaims

| Field | Type | Description |
|-------|------|-------------|
| `iss` | `str` | Issuer (always `"agentwrit"`) |
| `iss` | `str` | Issuer — identifies the broker that issued the token |
| `sub` | `str` | Subject — SPIFFE URI of the agent |
| `aud` | `list[str]` | Audience (may be empty) |
| `exp` | `int` | Expiration (Unix timestamp) |
Expand Down
2 changes: 1 addition & 1 deletion src/agentwrit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AgentClaims:
The `sub` field is a SPIFFE URI, ensuring the agent is a first-class
identity in the trust domain.
"""
iss: str # always "agentwrit"
iss: str # broker-configured issuer
sub: str # SPIFFE URI
aud: list[str]
exp: int # Unix timestamp
Expand Down
Loading