You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ff7a8ed
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: V2_DESIGN.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ It drops the HTTP wrappers, the sync/async duplication and DuckDB. What the libr
44
44
| Data | Plain dicts, exactly as the API returns them. |
45
45
| Writes | Dry run unless `submit=True`, matching the server. Routes with no dry run reject `submit`. |
46
46
| Reports and tag lists | The server endpoints become first-class features. A small local CSV filter and CSV/JSON export stay. |
47
+
| Report URLs |`client.report_url()` builds a report URL with the secret key in `?secretKey=`, for spreadsheets that pull a URL, and warns that the URL is a credential. Every other request sends the key in the header. |
47
48
| Interactive | A `t3api` CLI plus the Textual inspector (optional `[tui]` extra). The numbered menu is removed. |
48
49
| DuckDB and pyarrow | Removed entirely, because of Windows compatibility problems. |
49
50
| Package | Name stays `t3api-utils` (import `t3api_utils`). Python 3.12 or later. GPL-3.0-only. |
@@ -217,7 +218,7 @@ Later, not in 2.0.0: a `t3api stubs` command that writes TypedDicts for response
217
218
| Secret key |`X-T3-API-Key` header | Until deleted or disabled, or until the Metrc credentials behind it change | Default |
**Header only.**Secret keys go only in the header. The `?secretKey=` query form isn't supported, because it leaks into URLs and logs.
221
+
**Header only, except report URLs.**Requests send secret keys only in the header, because the `?secretKey=` query form leaks into URLs and logs. The one exception is `client.report_url()` (section 10), which deliberately puts the key in a URL for spreadsheets.
221
222
222
223
**How credentials are attached.** Each credential is an `httpx2.Auth` subclass attached to the client.
223
224
@@ -353,7 +354,7 @@ T3Error
353
354
-**HTTP debug logging:**`T3_LOG_HTTP=1`, or `connect(log_http=True)`, logs each request and response at DEBUG, including headers and bodies. `T3_LOG_FILE` writes it to a file.
354
355
-**What's hidden in those logs:**
355
356
-`Authorization`, `X-T3-API-Key` and cookie headers.
356
-
- The key in `/v2/auth/secretkey/{key}` paths.
357
+
- The key in `/v2/auth/secretkey/{key}` paths, and any `secretKey` query parameter.
357
358
-`password`, `otp` and `otpSeed` fields in JSON bodies.
358
359
359
360
1.x logged credential-login bodies, password included, whenever HTTP logging was on.
-**`licenses`** maps to the multi-valued `licenseNumber`. The spec allows up to 20 per call; more raises `ValueError`.
421
422
-**`to=`** streams the download to a file and returns its path. Without it, `report` returns `bytes`, or parsed JSON for `format="json"`.
422
423
-**Email delivery:**`delivery="email"` with `email=` asks the server to email the report instead.
424
+
-**Report URLs:**`client.report_url(endpoint, *, licenses, format, columns, filter, sort, ...)` returns a URL with the profile's secret key in `?secretKey=`, for Excel or Google Sheets to pull directly. Every report endpoint accepts this parameter.
425
+
- It sends no request.
426
+
- It needs a secret key; a JWT in a URL would stop working within 24 hours.
427
+
- Every call warns that anyone with the URL can use the key. Deleting the key (`t3api keys revoke`) is the only way to cut off a leaked URL; rotating keeps the same key value.
423
428
-**Saved reports and schedules** (`/v2/saved-reports`) are reachable through `client.request`. There's no dedicated helper in 2.0.0.
|`t3api endpoints [QUERY] [--kind K]`| Search the spec |
479
484
|`t3api pull ENDPOINT [-l LIC]... [--filter F]... [--sort S] [--mask M] [-o FILE] [--inspect]`| Load a collection to CSV or JSON (chosen by file extension), or open it in the inspector |
480
-
|`t3api report ENDPOINT [-l LIC]... [--format F] [-o FILE]`| Download a server report |
485
+
|`t3api report ENDPOINT [-l LIC]... [--format F] [-o FILE] [--url]`| Download a server report, or print its secret-key URL with `--url`|
481
486
|`t3api tag-lists list` / `create FILE --column C` / `resolve ID [-o FILE]`| Common tag-list tasks |
482
487
|`t3api inspect FILE`| Open a JSON or CSV file in the inspector |
483
488
|`t3api spec info` / `spec refresh`| Show the spec copy in use, or force a refresh |
@@ -526,7 +531,7 @@ GitHub Actions runs `uv sync`, then mypy and pytest. The matrix is Ubuntu, macOS
526
531
|`get_authenticated_client_or_error()` and about 22 other auth functions |`t3.connect()`|
527
532
|`*_with_validation` variants |`connect(validate=True)`, the default |
0 commit comments