Skip to content

feat: wire cloud modules through WASM ABI to Go and Node.js - #10

Merged
mostafa merged 3 commits into
mainfrom
feat/cloud-modules-wasm
May 9, 2026
Merged

mostafa merged 3 commits into
mainfrom
feat/cloud-modules-wasm

Conversation

@mostafa

@mostafa mostafa commented May 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Extends the WASM ABI PolicyConfig with a cloud_providers field, wiring it to the existing Rust core cloud modules (AWS, Azure, GCP)
  • Adds WithCloudProviders(...string) to the Go PolicyBuilder and addCloud()/cloudProviders to the Node.js PolicyBuilder/PolicyOptions
  • Adds 7 new shared test vectors for cloud provider conformance across all language bindings

Test plan

  • Rust: 110 tests pass (cargo test --workspace)
  • Go: full suite passes including 5 new TestCloudProviders subtests + 7 conformance vectors
  • Node.js: 91 tests pass including 7 new cloud tests + 7 conformance vectors
  • cargo clippy -p ressrf-wasm -- -D warnings clean
  • npx tsc --noEmit clean

mostafa and others added 3 commits May 9, 2026 23:25
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).
@mostafa
mostafa merged commit aa11064 into main May 9, 2026
19 checks passed
@mostafa
mostafa deleted the feat/cloud-modules-wasm branch May 9, 2026 21:39
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.
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.

1 participant