WEB Bridge Sideband

This commit is contained in:
Alexey
2026-09-08 21:29:32 +03:00
parent 4ca7418442
commit 021ad1fe68
23 changed files with 1169 additions and 13 deletions
+12 -2
View File
@@ -107,14 +107,24 @@ async fn read_managed_config_exposes_web_without_runtime_or_access_secrets() {
#[tokio::test]
async fn patch_web_debug_is_hot_and_limits_are_process_deferred() {
let (path, _directory) = temp_config("[web]\nenabled = false\n");
let active = ProxyConfig::load(&path).unwrap();
let debug_patch: Json = serde_json::json!({
"web": {"debug": {"enabled": true, "capture_headers": false}}
"web": {"debug": {
"enabled": true,
"sideband": true,
"capture_headers": false
}}
});
let debug = apply_patch_to_path(&path, &debug_patch, None)
let mut debug = apply_patch_to_path(&path, &debug_patch, None)
.await
.unwrap();
let desired = ProxyConfig::load(&path).unwrap();
reconcile_runtime_effect(&mut debug, &active, &desired).unwrap();
assert!(!debug.restart_required);
assert!(debug.runtime_reload_required);
assert!(!debug.process_restart_required);
assert!(debug.changed.iter().any(|section| section == "web"));
assert!(desired.web.debug.sideband);
let limits_patch: Json = serde_json::json!({
"web": {"limits": {"max_http_connections": 2049}}
+5
View File
@@ -67,6 +67,11 @@ pub(super) async fn render(
push_filter_form(&mut html, &query);
html.push_str("<section><h2>Store</h2><table><tbody>");
summary_row(&mut html, "debug enabled", yes_no(status.policy.enabled));
summary_row(
&mut html,
"sideband",
yes_no(status.policy.bridge_diagnostics_enabled()),
);
summary_row(&mut html, "body capture", body_mode(&status.policy));
summary_row(&mut html, "window seconds", &query.window_secs.to_string());
summary_row(
+2
View File
@@ -22,6 +22,7 @@ fn html_escaping_covers_active_markup_characters() {
async fn renderer_filters_groups_and_sets_control_plane_security_headers() {
let policy = WebDebugConfig {
enabled: true,
sideband: true,
..Default::default()
};
let limits = crate::config::WebLimitsConfig {
@@ -58,6 +59,7 @@ async fn renderer_filters_groups_and_sets_control_plane_security_headers() {
let body = response.into_body().collect().await.unwrap().to_bytes();
let body = std::str::from_utf8(&body).unwrap();
assert!(body.contains("session_created"));
assert!(body.contains("<th>sideband</th><td>yes</td>"));
assert!(body.contains("0123456789abcdef"));
assert!(body.contains("192.0.2.40"));
}