Repository navigation
Server reads one resolved listen address + Seam 1 harness (#3) - #10
Merged
Merged
Conversation
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
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: #3