This commit is contained in:
Alexey
2026-08-27 00:06:37 +03:00
parent 1b3477a333
commit 14e8d10ad3
34 changed files with 221 additions and 299 deletions
+1 -3
View File
@@ -43,9 +43,7 @@ pub(super) fn validate(timeouts: &WebTimeoutsConfig) -> Result<()> {
return config_error("web.timeouts.websocket_open_secs must be within [1, 300]");
}
if timeouts.lane_open_wait_secs > timeouts.long_poll_secs {
return config_error(
"web.timeouts.lane_open_wait_secs must not exceed long_poll_secs",
);
return config_error("web.timeouts.lane_open_wait_secs must not exceed long_poll_secs");
}
if timeouts.carrier_health_secs > timeouts.reconnect_grace_secs {
return config_error(
@@ -50,7 +50,10 @@ fn web_config_builds_canonical_runtime_snapshot() {
assert_eq!(vhost.profiles[0].key_fingerprint.len(), 16);
assert_ne!(vhost.profiles[0].key_fingerprint, "0001020304050607");
assert!(!vhost.profiles[0].carrier_negotiation_enabled);
assert_eq!(vhost.profiles[0].carriers.as_ref(), [WebCarrier::HttpsLanes]);
assert_eq!(
vhost.profiles[0].carriers.as_ref(),
[WebCarrier::HttpsLanes]
);
}
#[test]
@@ -95,11 +98,7 @@ fn web_carrier_array_enables_ordered_negotiation_and_appends_fallback() {
#[test]
fn web_carriers_reject_true_empty_and_duplicates() {
for value in [
"true",
"[]",
"[\"https\", \"https\"]",
] {
for value in ["true", "[]", "[\"https\", \"https\"]"] {
let invalid = WEB_CONFIG.replace(
"carrier = \"https-lanes\"",
&format!("carrier = \"https-lanes\"\ncarriers = {value}"),
+2 -2
View File
@@ -56,12 +56,12 @@ pub use web::{
WebCarrierNegotiationAggressiveness, WebConfig, WebDecoyConfig, WebLimitsConfig,
WebProfileConfig, WebSecretMode, WebTimeoutsConfig, WebVhostConfig,
};
#[allow(unused_imports)]
pub use web_carrier::{WebCarrier, WebCarriers};
pub(crate) use web::{
WebRuntimeConfig, WebRuntimeDecoy, WebRuntimeProfile, WebRuntimeVhost, WebStaticAsset,
WebStaticSite,
};
#[allow(unused_imports)]
pub use web_carrier::{WebCarrier, WebCarriers};
pub(crate) use web_debug::web_debug_fits_limits;
pub use web_debug::{WebDebugBodyCapture, WebDebugConfig};
+3 -6
View File
@@ -234,8 +234,7 @@ impl Default for WebLimitsConfig {
websocket_admission_watermark_pct: default_web_websocket_admission_watermark_pct(),
websocket_eviction_watermark_pct: default_web_websocket_eviction_watermark_pct(),
websocket_http_connection_reserve: default_web_websocket_http_connection_reserve(),
max_websocket_evictions_in_flight:
default_web_max_websocket_evictions_in_flight(),
max_websocket_evictions_in_flight: default_web_max_websocket_evictions_in_flight(),
max_carrier_learning_entries: default_web_max_carrier_learning_entries(),
max_body_readers: default_web_max_body_readers(),
max_body_bytes_global: default_web_max_body_bytes_global(),
@@ -348,8 +347,7 @@ impl Default for WebTimeoutsConfig {
websocket_write_secs: default_web_websocket_write_secs(),
websocket_backpressure_secs: default_web_websocket_backpressure_secs(),
websocket_eviction_secs: default_web_websocket_eviction_secs(),
carrier_negotiation_deadlines_secs:
default_web_carrier_negotiation_deadlines_secs(),
carrier_negotiation_deadlines_secs: default_web_carrier_negotiation_deadlines_secs(),
carrier_learning_secs: default_web_carrier_learning_secs(),
bootstrap_lifetime_secs: default_web_bootstrap_lifetime_secs(),
reconnect_grace_secs: default_web_reconnect_grace_secs(),
@@ -436,8 +434,7 @@ impl Default for WebConfig {
carrier: WebCarrier::default(),
carriers: WebCarriers::default(),
carrier_learning: default_web_carrier_learning(),
carrier_negotiation_aggressiveness:
WebCarrierNegotiationAggressiveness::default(),
carrier_negotiation_aggressiveness: WebCarrierNegotiationAggressiveness::default(),
limits: WebLimitsConfig::default(),
debug: WebDebugConfig::default(),
timeouts: WebTimeoutsConfig::default(),