Add HTTP egress policy option#5506
Open
clockwork-labs-bot wants to merge 2 commits into
Open
Conversation
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.
Description of Changes
Adds a runtime HTTP egress policy for module HTTP requests.
The default policy preserves existing behavior:
allow_loopback_http_for_testsdefault to allowing loopback for tests, while still allowing normal public addresses.A separate
loopback-onlypolicy blocks all non-loopback resolved and literal IP addresses. Standalone exposes this as--http-egress-policywith these values:public-internetallow-loopbackloopback-onlyThe same policy can also be set in
config.tomlashttp-egress-policy.API and ABI breaking changes
None.
Expected complexity level and risk
InstanceEnv, but the selected policy is now wired through standalone config, host runtime config, module creation, and both WASM and V8 instance creation.Testing
PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo fmt --allLC_ALL=C LC_CTYPE=C LANG=C PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo test -p spacetimedb-core host::instance_env::test:: --libLC_ALL=C LC_CTYPE=C LANG=C PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo test -p spacetimedb-core --features allow_loopback_http_for_tests host::instance_env::test:: --libLC_ALL=C LC_CTYPE=C LANG=C PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo test -p spacetimedb-core config::tests:: --libLC_ALL=C LC_CTYPE=C LANG=C PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo test -p spacetimedb-standalone subcommands::start::tests:: --libLC_ALL=C LC_CTYPE=C LANG=C PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH cargo check -p spacetimedb-testinggit diff --check