Repository navigation
feat: wire cloud modules through WASM ABI to Go and Node.js - #10
Merged
Merged
Conversation
The Rust core already implements AWS, Azure, and GCP cloud provider modules. This commit extends the WASM ABI PolicyConfig with a cloud_providers field and exposes it in both Go and Node.js bindings: - ressrf-wasm: add cloud_providers Vec<String> to PolicyConfig, call PolicyBuilder::with_cloud() for each recognized provider - Go: add WithCloudProviders(...string) to PolicyBuilder, serialize in config JSON - Node.js: add cloudProviders to PolicyOptions, addCloud() to PolicyBuilder, cloud shorthand on externalOnly()/internalOnly() - Shared vectors: 7 new cloud-specific cases in policy_decisions.json - Conformance: Go and Node.js tests now process cloud_providers field All test suites pass (Rust 110, Go full suite, Node.js 91 tests).
gonzaloserrano
added a commit
that referenced
this pull request
May 27, 2026
Both bindings' DisableForTests register a t.Cleanup that flips the testbypass.Flag back to false on test exit. No test verified the re-enable actually fired — the single existing TestDisableForTests in each binding only asserts bypass is active during a test. A future refactor that drops the t.Cleanup line or swaps its order with Store(true) would let bypass leak into every subsequent test in the same package. Every "should be blocked" test in adjacent tests would then silently pass regardless of the policy: an order-dependent Heisenbug invisible until somebody reorders. The nested-subtest shape is load-bearing — without it, the parent test's Cleanup runs after the assertion and the test is meaningless. Reproduced by removing the t.Cleanup line: the test FAILs at "bypass leaked past subtest cleanup". Both new tests live in ressrftest_test (black-box) so they exercise the consumer-facing surface. The packages don't exist yet, so this also creates them. Addresses td-code-review finding #10.
gonzaloserrano
added a commit
that referenced
this pull request
May 27, 2026
Both bindings' DisableForTests register a t.Cleanup that flips the testbypass.Flag back to false on test exit. No test verified the re-enable actually fired — the single existing TestDisableForTests in each binding only asserts bypass is active during a test. A future refactor that drops the t.Cleanup line or swaps its order with Store(true) would let bypass leak into every subsequent test in the same package. Every "should be blocked" test in adjacent tests would then silently pass regardless of the policy: an order-dependent Heisenbug invisible until somebody reorders. The nested-subtest shape is load-bearing — without it, the parent test's Cleanup runs after the assertion and the test is meaningless. Reproduced by removing the t.Cleanup line: the test FAILs at "bypass leaked past subtest cleanup". Both new tests live in ressrftest_test (black-box) so they exercise the consumer-facing surface. The packages don't exist yet, so this also creates them. Addresses td-code-review finding #10.
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
PolicyConfigwith acloud_providersfield, wiring it to the existing Rust core cloud modules (AWS, Azure, GCP)WithCloudProviders(...string)to the GoPolicyBuilderandaddCloud()/cloudProvidersto the Node.jsPolicyBuilder/PolicyOptionsTest plan
cargo test --workspace)TestCloudProviderssubtests + 7 conformance vectorscargo clippy -p ressrf-wasm -- -D warningscleannpx tsc --noEmitclean