feat(testcontainers): outbound TLS trust (upstreamTrust) on RiftContainer - #249
Merged
Merged
Conversation
…iner UpstreamTrust reached the embedded and spawn transports in 0.3.0, but a RiftContainer user had no way to make a proxy stub (or the intercept listener's origin leg) trust an HTTPS origin behind a private CA, so the container transport could not record such an origin at all. withUpstreamTrust takes all three variants. The engine already reads its trust flags from the environment (RIFT_UPSTREAM_CA_FILE / RIFT_UPSTREAM_TLS_SKIP_VERIFY), which is how the container already passes MB_APIKEY and RIFT_INTERCEPT_PORT, so no command override is needed. CaFile and CaPem are both written into the container, which is why a container, unlike spawn, can take an inline PEM. SkipVerify logs the same development-only warning as the other transports. The policy is applied in configure(), at start: a replaced policy leaves nothing behind, and a CaFile is read when the engine starts, as elsewhere. An image tag that is a version older than 0.18.0 is refused up front, sharing the gate with SpawnOptions through UpstreamTrust.MIN_ENGINE_VERSION / supportedBy. Closes #248
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.
RiftContainer.withUpstreamTrust(UpstreamTrust)brings outbound TLS trust to the testcontainers transport.CaFileand inlineCaPemare copied into the container and named to the engine throughRIFT_UPSTREAM_CA_FILE.SkipVerifysetsRIFT_UPSTREAM_TLS_SKIP_VERIFYand logs the same development-only warning as the other transports.An image tag that is a version older than 0.18.0 is refused up front, through a gate now shared with
SpawnOptions(UpstreamTrust.MIN_ENGINE_VERSION/supportedBy). A new liveRiftContainerUpstreamTrustITmirrorsUpstreamTrustIT: with no trust the private-CA origin is refused, and with CaFile, CaPem or SkipVerify it is reached.Closes #248
🤖 Generated with Claude Code