Skip to content

Server reads one resolved listen address + Seam 1 harness (#3) - #10

Merged
Khang5687 merged 2 commits into
fork-mainfrom
feat/resolved-listen-address
Sep 6, 2026
Merged

Khang5687 merged 2 commits into
fork-mainfrom
feat/resolved-listen-address

Conversation

@Khang5687

Copy link
Copy Markdown
Owner

Ticket: #3

Bind host, URL host, loopback detection and remote-reachability were
each re-derived from raw config in startupAccess, auth policy, pair CLI
and runtime state, so a wildcard bind got mapped to a concrete address
in several slightly different ways.

Add a ListenAddress service (apps/server/src/listenAddress.ts) that
resolves the config host to { kind, bindHost, urlHost, remoteReachable }
once at startup. Provide it through the server environment layer and
have startupAccess, EnvironmentAuth/Policy, SessionStore, pair, and
serverRuntimeState consume the resolved value instead of re-deriving it.

Refs #3
Ticket #3 acceptance criteria 3-5 were unshipped: nothing proved what the
real listener binds or what auth policy it advertises per `--host`.

Add a fork-only in-process harness (apps/server/src/testUtils/listenHarness.ts)
that boots HttpServerLive + the auth HTTP group with an injectable
network-interface map, probes address:port with a raw TCP connect
(accept vs refuse), and reads `auth.policy` from the unauthenticated
/api/auth/session descriptor. Characterization cases: default config binds
127.0.0.1 (accepts), [::1] refused, policy loopback-browser; explicit
--host 0.0.0.0 binds wildcard, policy remote-reachable.

Tests use `it.live`: under `it.effect`'s TestClock the boot self-interrupts.
Run under Node (CI runtime) and Bun 1.3.14: same outcomes on both.
No upstream files touched.

Khang5687/t3code #3
@Khang5687
Khang5687 merged commit 70554bd into fork-main Sep 6, 2026
7 of 15 checks passed
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant