@hasna/todos 0.12.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1421,18 +1421,37 @@ MCP calls such as `get_task`, `get_status`, `get_context`, `bootstrap`, and
1421
1421
  todos-serve
1422
1422
  ```
1423
1423
 
1424
- Generate an API key before exposing the REST API to another app. Once at least one
1425
- generated key exists, all `/api/*` requests require `x-api-key` or
1426
- `Authorization: Bearer`.
1424
+ `/api/*` and `/mcp` are **local-only data planes and they fail closed**. The server
1425
+ refuses to start unless one of the following is true:
1426
+
1427
+ | Configuration | Result |
1428
+ | --- | --- |
1429
+ | `TODOS_API_KEY=<key>` (or `--api-key <key>`) | `/api/*` + `/mcp` require the key |
1430
+ | at least one `todos api-keys create` key exists | `/api/*` + `/mcp` require a key |
1431
+ | `--allow-anonymous` **and** a loopback bind | anonymous, loopback peers only (local dev) |
1432
+ | a cloud `DATABASE_URL` is configured (hosted `/v1` deployment) | `/api/*` + `/mcp` are **not served**; `/v1` stays authenticated |
1433
+ | nothing of the above | **server exits non-zero** with the env var to set |
1427
1434
 
1428
1435
  ```bash
1429
- todos api-keys create "My app"
1430
- todos-serve --host 0.0.0.0
1436
+ todos api-keys create "My app" # then send x-api-key / Authorization: Bearer
1437
+ TODOS_API_KEY=<key> todos-serve --host 0.0.0.0
1438
+ todos serve --allow-anonymous # local dev only; refused for a non-loopback --host
1431
1439
  ```
1432
1440
 
1441
+ `--allow-anonymous` (or `TODOS_ALLOW_ANONYMOUS=1`) is refused for any non-loopback
1442
+ bind host, and even when enabled it only serves requests whose transport peer is
1443
+ itself loopback — so it can never publish an anonymous task read/write plane
1444
+ off-box. `todos-mcp --http` sets it implicitly because that transport is pinned to
1445
+ `127.0.0.1`; set `TODOS_API_KEY` (and send it from your MCP client) to require a
1446
+ credential there too.
1447
+
1433
1448
  Pass the generated key from your app as `x-api-key` or set `TODOS_API_KEY` for
1434
1449
  the SDK client.
1435
1450
 
1451
+ Always-on / hosted deployments should use the versioned `/v1` API, which
1452
+ authenticates independently against the cloud key store. `/health`, `/ready`,
1453
+ `/version` and `/openapi.json` are the only routes that are public by design.
1454
+
1436
1455
  Agent callers can trim REST responses with field selectors:
1437
1456
 
1438
1457
  ```bash
@@ -1 +1 @@
1
- {"version":3,"file":"config-serve-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config-serve-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QA63C3D"}
1
+ {"version":3,"file":"config-serve-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config-serve-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QA44C3D"}