WS-F: review fixes (tool errors, size caps, untrusted-data notes, tests)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
1 parent
e96bd716a6
commit
c9394990ea
3 files changed
+279
-32
No files matched your search
@@ -59,3 +59,4 @@ Tick these in [`TODO.md`](../../TODO.md).
|
||||
|
||||
- 2026-10-15: Card created.
|
||||
- 2026-10-15: Implemented on branch `ws-f/mcp-server`. Prompts and resources are hand-written `ServerHandler` methods (helpers in `prompts.rs`/`resources.rs` are testable without a request context). `tail_journal` follows with a 10-entry backlog, stops at `max_follow_secs` or `max_lines`. Origin validation is enforced (`enforce_origin_validation`) with loopback and bind origins on `server.port` plus configured extras. Tests use real time (1s cap) because tokio `test-util` is not enabled in Cargo.toml.
|
||||
- 2026-10-15: Review fixes. Tool handlers return source errors as `CallToolResult::error` (is_error) with an actionable message; prompts/resources keep protocol errors. Log tools return `{entries, truncated, note}` capped at 256 KiB. `tail_journal` notes reader-closed, shutdown and entry-cap stops; `seconds` defaults to 10 (schema 0-3600, server clamps to `max_follow_secs`). Log content is documented as untrusted data; `diagnose_unit` validates `name`. Notes: rmcp accepts requests with no `Origin` header, so bearer auth is the real gate; Origin/Host checks defend against browser DNS-rebinding. With `server.bind = 0.0.0.0`, LAN clients need their Host names in `server.allowed_hosts` (a startup warning is logged otherwise).
|
||||
Reference in new issue
Block a user