feat: add daemon websocket subscriptions#290
Conversation
|
Terminal implementation evidence:
Merge remains guarded on exact-head hostile review and green CI. |
|
Fresh exact-head hostile GJC review completed for Verdict: PASS ( CI is still running; merge remains blocked until every required exact-head check is green. |
|
MERGE_READY terminal receipt:
No inherited |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42fe88d554
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| async fn list_subscriptions( | ||
| _peer: LoopbackLanePeer, | ||
| State(state): State<AppState>, |
There was a problem hiding this comment.
Apply the Host guard to subscription reads
When a DNS-rebinding page resolves an attacker-controlled hostname to 127.0.0.1, the peer address is loopback but the Host header is not; these GET handlers only require LoopbackLanePeer, so /api/subscriptions and /api/subscriptions/{name} can expose lifecycle snapshots despite the new Host-check helper and README saying subscription operations are protected by numeric loopback Host checks. Add the same Host validation used by the control extractor for these read endpoints, even if they do not require the mutation header.
Useful? React with 👍 / 👎.
| host.parse::<std::net::IpAddr>().is_ok_and(|ip| { | ||
| ip.is_loopback() | ||
| || matches!(ip, std::net::IpAddr::V6(ip) if ip.to_ipv4().is_some_and(|ip| ip.is_loopback())) | ||
| }) |
There was a problem hiding this comment.
Make loopback host rules consistent
If a user configures daemon.base_url as http://localhost:25294, the client accepts it as a private loopback daemon URL, but request_host_is_loopback passes localhost into this helper and it returns false because only numeric IPs parse here; subscribe start/stop then fail with local_control_rejected even though other private client calls allow the same base URL. Either reject localhost client-side with a clear error for subscription control or accept it in this Host check.
Useful? React with 👍 / 👎.
Summary
clawhip subscribe validate|list|status|start|stopIncomingEventvalues through the existing Routerworkflow_gate/questionexamplesSecurity boundaries
Verification
cargo fmt --all -- --checkcargo clippy -- -D warningscargo test(705 unit tests plus all integration suites)cargo build --releasescripts/internal-pr-format-gate.shCloses #289
—
[repo owner's gaebal-gajae (clawdbot) 🦞]