Skip to content

Adopt rift#1517: spawn-mode imposters inherit --host 127.0.0.1 - #334

Merged
EtaCassiopeia merged 1 commit into
masterfrom
docs/rift-321-spawn-imposter-host
Oct 17, 2026
Merged

EtaCassiopeia merged 1 commit into
masterfrom
docs/rift-321-spawn-imposter-host

Conversation

@EtaCassiopeia

Copy link
Copy Markdown
Collaborator

Summary

From rift 0.23.0, a spawned engine's host-less imposters bind its --host, as Mountebank's do (rift#1517, PR achird-labs/rift#1541). --local-only also now refuses non-loopback clients on imposters, not only on the admin API (rift#1523, PR achird-labs/rift#1543). That second change came out of the 0.23.0 survey and was added to this issue.

With the SDK's spawn defaults (127.0.0.1, localOnly on), spawned imposters are therefore loopback-only. A system under test in a container reaches one only when:

  • the imposter names its own interface with host("0.0.0.0"); and
  • on Linux, the engine is spawned with localOnly(false). Docker Desktop forwards to loopback and is admitted either way.

The SDK still sends --host and does not override it. The engine's new default is the safer one, and widening it silently would undo an upstream security fix. The SpawnOptions.host docs said the opposite of the new behaviour, so this PR fixes the docs and pins both behaviours with a live IT.

  • SpawnOptions.Builder.host javadoc: host-less imposters bind it from 0.23.0, plus the container recipe.
  • SpawnOptions.Builder.localOnly javadoc (new): from 0.23.0 it refuses non-loopback clients on imposters too.
  • docs/design/sdk-api.md: the same notes on host and localOnly.
  • docs/testcontainers.md: a new section, "A spawned engine reached from a container", with the recipe.
  • Stale comments fixed in Ipv6HostIT and ImposterUriHostTest.

Tests

SpawnHostInheritanceIT (conformance, SPAWN lane, live rift 0.23.0) probes over the machine's own non-loopback IPv4 address and is skipped when there is none:

  • a host-less imposter answers on 127.0.0.1 and is unreachable on the LAN address;
  • host("0.0.0.0") with the default localOnly is dropped at accept;
  • host("0.0.0.0") with localOnly(false) answers 200.

On 0.22.0 the first case fails, because host-less imposters bound every interface. Both tests ran rather than being skipped.

Verification

The core and conformance unit tests pass against the 0.23.0 corpus. SpawnHostInheritanceIT passes against the rift 0.23.0 binary.

rift-scala: the same note belongs on its SpawnConfig.host scaladoc (noted on achird-labs/rift-scala#220).

Closes #321

🤖 Generated with Claude Code

…them from rift 0.23.0

rift 0.23.0 binds a host-less imposter to the spawned engine's --host, as
Mountebank does (rift#1517), and --local-only now refuses non-loopback clients
on imposters too (rift#1523). With the SDK's defaults (127.0.0.1, localOnly on)
spawned imposters are loopback-only, so a containerised system under test needs
host("0.0.0.0") on the imposter and localOnly(false) on Linux. The SpawnOptions
docs said the reverse; they now give the recipe, and a live IT pins both
behaviours.

Closes #321
@EtaCassiopeia
EtaCassiopeia merged commit d4a3995 into master Oct 17, 2026
18 checks passed
@EtaCassiopeia
EtaCassiopeia deleted the docs/rift-321-spawn-imposter-host branch October 17, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt rift#1517: spawn-mode imposters inherit --host 127.0.0.1

1 participant