Skip to content

Commit 3e62c5b

Browse files
committed
Add standalone Wasm policy binary smoke
1 parent 230dabd commit 3e62c5b

12 files changed

Lines changed: 441 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ behavior when the change improves security or project direction.
2828
by the human launcher and release gate.
2929
- Fix the human test starter's Wasm entry so sandbox and policy scripts are no
3030
longer passed as unused arguments to the registry validator.
31+
- Add a standalone binary smoke that loads generated modules from a private
32+
plugin root with exact digests and exercises all four migration families
33+
through a file-based configuration and real HTTP traffic.
34+
35+
### Fixed
36+
37+
- Do not initialize or log errors for the native disk-cache backend when a
38+
cache policy enables only the memory tier.
3139

3240
### Security
3341

crates/fluxheim-observability/src/otlp_http.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ impl OtlpHttpEndpoint {
4949
pub fn parse(endpoint: &str) -> Option<Self> {
5050
let (rest, default_port) = if let Some(rest) = endpoint.strip_prefix("http://") {
5151
(rest, 80)
52-
} else if let Some(rest) = endpoint.strip_prefix("https://") {
53-
(rest, 443)
5452
} else {
55-
return None;
53+
(endpoint.strip_prefix("https://")?, 443)
5654
};
5755
let (authority, path) = rest.split_once('/')?;
5856
if authority.is_empty() || path.is_empty() {

crates/fluxheim-observability/src/otlp_trace.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ impl HttpEndpoint {
100100
fn parse(endpoint: &str) -> Option<Self> {
101101
let (rest, default_port) = if let Some(rest) = endpoint.strip_prefix("http://") {
102102
(rest, 80)
103-
} else if let Some(rest) = endpoint.strip_prefix("https://") {
104-
(rest, 443)
105103
} else {
106-
return None;
104+
(endpoint.strip_prefix("https://")?, 443)
107105
};
108106
let (authority, path) = rest.split_once('/')?;
109107
if authority.is_empty() || path.is_empty() {

crates/fluxheim-server/src/native_http1_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub(crate) struct NativeDiskCacheStats {
112112

113113
impl NativeDiskCache {
114114
pub(crate) fn from_config(config: &CacheConfig) -> Option<Self> {
115-
if !native_disk_cache_supported(config) {
115+
if !config.disk.enabled || !native_disk_cache_supported(config) {
116116
return None;
117117
}
118118
let (root, backend) = match NativeDiskCacheBackend::from_config(config) {

crates/fluxheim-server/src/native_http1_cache_tests.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ fn disk_cache_store_key(key: &str) -> NativeDiskCacheStoreKey {
7676
}
7777
}
7878

79+
#[test]
80+
fn disabled_disk_cache_does_not_require_a_path() {
81+
let config = CacheConfig {
82+
enabled: true,
83+
memory: fluxheim_config::CacheMemoryConfig {
84+
enabled: true,
85+
..Default::default()
86+
},
87+
..Default::default()
88+
};
89+
90+
assert!(NativeDiskCache::from_config(&config).is_none());
91+
}
92+
7993
#[test]
8094
fn native_peer_fill_cache_ttl_subtracts_upstream_age() {
8195
let cache = CacheConfig::default();

docs/wasm-policy-example-parity.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,9 @@ source-to-module builds and digest output, while `scripts/smoke_wasm_all.sh`
206206
is the single orchestration entry used by both `scripts/test_starter.py` and
207207
the opt-in stable/deep release gate. This avoids treating multiple script paths
208208
as arguments to one launcher command and keeps human and CI coverage aligned.
209+
210+
The standalone `scripts/smoke_wasm_policy_examples_binary.sh` proof also loads
211+
the generated files through a private plugin root and exact SHA-256 pins,
212+
starts the real Fluxheim binary from a file-based config, and sends HTTP
213+
traffic through all four vhosts. The in-process listener tests remain the
214+
faster detailed regressions; both layers are required by the complete smoke.

examples/wasm/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ digest, and keep the deployed file owner-only or otherwise protected by the
1919
documented plugin-root trust policy. The builder has no output-path argument;
2020
it cannot be redirected into a configured production root accidentally.
2121

22+
Run the full standalone deployment proof with:
23+
24+
```sh
25+
scripts/smoke_wasm_policy_examples_binary.sh
26+
```
27+
28+
It copies the generated modules into a private temporary plugin root, writes a
29+
file-based config with exact digests, launches the actual `fluxheim` binary and
30+
two local origins, and sends real HTTP traffic through all four policy
31+
families. This is separate from the faster in-process listener regressions.
32+
2233
`irules-access-policy.wat` and `irules-access-policy.toml` demonstrate the
2334
F5 iRules-style access-policy mapping. Fluxheim first classifies the request
2435
through configured vhosts, routes, methods, trusted-client ACLs, and TLS

packaging/rpm/fluxheim.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ fi
161161
- Add the HAProxy Lua/SPOE-style bounded route and load-balancer example.
162162
- Complete the VCL-like cache-policy example and live operational smoke.
163163
- Add deterministic Wasm example builds and one shared complete Wasm gate.
164+
- Add standalone file-config and binary coverage for all Wasm policy examples.
165+
- Avoid disabled disk-cache initialization for memory-only cache policies.
164166
- Harden snapshot opens against pathname races and isolate corruption fixtures
165167
behind safe store primitives.
166168

release-notes/RELEASE_NOTES_1.7.9.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ products.
3232
- Add one complete Wasm smoke shared by `scripts/test_starter.py` and the
3333
opt-in stable/deep release gate, fixing the launcher's previous multi-script
3434
command wiring.
35+
- Add a standalone binary smoke using generated modules, exact digest pins, a
36+
private plugin root, file-based configuration, two local origins, and real
37+
HTTP traffic through every migration family.
38+
39+
## Fixed
40+
41+
- Stop attempting to initialize the native disk-cache backend for memory-only
42+
cache policies, avoiding an incorrect missing-path error at startup.
3543

3644
## Security
3745

scripts/smoke_wasm_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ scripts/build_wasm_policy_examples.sh
55
scripts/validate-wasm-config-registry.sh
66
scripts/smoke_wasm_sandbox.sh
77
scripts/smoke_wasm_policy_examples.sh
8+
scripts/smoke_wasm_policy_examples_binary.sh
89

910
echo "wasm complete smoke: ok"

0 commit comments

Comments
 (0)