Repository navigation
Conversation
Add WebTransport.host (default "*", unchanged behaviour), start Warp via runSettings with setHost/setPort, and add Application.withHost/withPort. Adds ADR-0079, spec 019, release fragment and BindSpec.
…rp.run behaviour
A "*" default would silently start listening on IPv6 on dual-stack hosts whose
firewall rules only cover IPv4 — a new reachable surface that does not belong in
a make-it-configurable change. IPv6 ("*") and loopback ("127.0.0.1") are both
opt-in through Application.withHost. ADR-0079, change 019, the release fragment
and BindSpec updated accordingly.
Gates: ./dev test 'Service.Transport.Web.Bind' nhcore-test-service 12/0; ./dev spec-check 019 OK; ./dev lint No hints; ./dev check Up to date; git diff --check 0.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Preliminary automated checks — maintainer review pendingReviewed
Local receipts: structural spec validation, signature drift, ADR index, codemap validation, release-fragment validation, expectation guard and whitespace check passed. Exact criterion resolution failed as above. Compilation, the Haskell test run and local HLint could not execute here because the toolchain is absent; the PR author's runtime results have not been independently reproduced. |
…concile default-host wording, exact C1 locator, C5 as http:real with attestation, order-independent override coverage
- ADR-0079 consequence and withHost Haddock now say the default is "*4" (unchanged from Warp.run); change 019 user impact says server { port = ... } keeps its port.
- C1 locator is the exact example name; ./dev spec-check --criteria-tests cab923c resolves.
- C5 reclassified integration | http:real with an exact attestation in docs/changes/test-surfaces.json.
- New pure Web.applyBindOverrides (used by runWebTransport) + C6: overrides apply before or after withTransport; absent overrides preserve a transport's custom host/port.
- BindSpec 12 -> 14 examples, 0 failures; lint no hints; codemap regenerated.
Maintainer-reviewed follow-up — specification correctionsNick reviewed and authorized these additional requests for 1. Input and failure behavior is underspecified
withPort port app =
app {bindPort = Just port}2. Health reachability does not establish loopback isolation or instance identity
status <- getHealthStatus freePort 50
status |> shouldBe 200
3. Make single-setting preservation coverage explicit
4. Qualify reverse-proxy guidance by network scope
No migration recipe is requested for internal NeoHaskell constructors/record representations: the intended supported application API is the builder surface. Compilation and runtime tests have not been independently executed in this review environment. |
… — bind input contract, loopback-exclusion evidence, single-setting coverage, proxy guidance 1. Input/failure contract: pure Web.validateBindHost / validateBindPort run in runWebTransport before any socket opens (empty host, URL/path, host:port, whitespace; port 0 and out-of-range rejected), error names the builder. Warp.runSettings now goes through Task.fromFailableIO @IOException and fails as 'WebTransport could not bind <host>:<port>' on the existing Task.finally cleanup path. 2. Loopback evidence: per-test unique health path (instance identity) plus a discriminating probe — the port stays bindable on a non-loopback address only for a loopback listener; wildcard-bind negative control proves the probe fails otherwise. 3. Single-setting preservation split into explicit host-only / port-only examples. 4. Reverse-proxy guidance qualified by network namespace in the release fragment, withHost/WebTransport.host Haddock, ADR-0079 and change 019. Spec 019: C5 widened, C6 lists the single-setting examples, C7 (validation) and C8 (startup failures, integration | http:real) added; 4 attestations. BindSpec 14 -> 27 examples, 0 failures; lint no hints; spec-check, criteria-tests, spec-drift, codemap-check, changelog --check OK.
|
Thanks — all four addressed in 676c06a (on top of 3115eae). Still a draft; not marking ready until you say so. 1. Input and failure behaviorDefined and enforced, no wrapper types, no lifecycle rewrite:
Tests: 2. Loopback exclusion and instance identityThe probe now distinguishes both:
Both are source-reasoned, bounded fixture checks (plain 3. Single-setting preservationSplit into explicit examples: absent/absent preserves a custom host and port; host-only override keeps the custom port ( 4. Reverse-proxy guidanceQualified in the release fragment, the Spec / gatesChange 019: C5 widened (identity + exclusion + negative control), C6 lists the single-setting examples, new C7 (validation) and C8 (startup failures, Local: One thing worth your eye: the exclusion probe picks the machine's first routable IPv4 via a connect-only UDP socket (nothing is sent). If a runner has no non-loopback IPv4 it falls back to |
|
I found one more thing to fix:
Thanks! |
Apps can choose their web server's address and port with
Application.withHostandApplication.withPort. A loopback bind such as127.0.0.1is suitable for a reverse proxy that can reach the application's network namespace. A proxy in another namespace generally cannot reach that listener through its own loopback.Without overrides, the default stays
*4(all IPv4 interfaces) on port 8080. A transport's existing custom host or port is preserved when the corresponding application override is absent. IPv6 remains opt-in.Review follow-up
unit / none; C9's occupied-port test isintegration / http:real. C5/C9 attestations use the actual printed BindSpec fixture group.Verification
./dev test "Service.Transport.Web.Bind" nhcore-test-service: 29 examples, 0 failures.The full PostgreSQL/Hurl suite was not rerun. Still a draft; no final maintainer approval is claimed. The supported builder API needs no migration. The release note records the added fields for code constructing the internal records directly.
Spec 019 · ADR-0079.