Repository navigation
Adopt rift#1517: spawn-mode imposters inherit --host 127.0.0.1 - #334
Merged
Merged
Conversation
…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
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.
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-onlyalso 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,localOnlyon), spawned imposters are therefore loopback-only. A system under test in a container reaches one only when:host("0.0.0.0"); andlocalOnly(false). Docker Desktop forwards to loopback and is admitted either way.The SDK still sends
--hostand does not override it. The engine's new default is the safer one, and widening it silently would undo an upstream security fix. TheSpawnOptions.hostdocs said the opposite of the new behaviour, so this PR fixes the docs and pins both behaviours with a live IT.SpawnOptions.Builder.hostjavadoc: host-less imposters bind it from 0.23.0, plus the container recipe.SpawnOptions.Builder.localOnlyjavadoc (new): from 0.23.0 it refuses non-loopback clients on imposters too.docs/design/sdk-api.md: the same notes onhostandlocalOnly.docs/testcontainers.md: a new section, "A spawned engine reached from a container", with the recipe.Ipv6HostITandImposterUriHostTest.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:127.0.0.1and is unreachable on the LAN address;host("0.0.0.0")with the defaultlocalOnlyis dropped at accept;host("0.0.0.0")withlocalOnly(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.
SpawnHostInheritanceITpasses against the rift 0.23.0 binary.rift-scala: the same note belongs on its
SpawnConfig.hostscaladoc (noted on achird-labs/rift-scala#220).Closes #321
🤖 Generated with Claude Code