Skip to content

Commit e1a532d

Browse files
committed
Fix peer fill feature matrix checks
1 parent fadee66 commit e1a532d

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

src/cli.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,9 @@ fn run_cache_key_command(options: CacheKeyOptions<'_>) -> Result<(), Box<dyn Err
22682268
expect_namespace,
22692269
expect_key_namespace,
22702270
expect_user_tag,
2271+
expect_peer_fill_enabled,
2272+
expect_peer_fill_peers,
2273+
expect_peer_fill_max_concurrent_requests,
22712274
} = options;
22722275
let _ = (
22732276
config_path,
@@ -2291,6 +2294,9 @@ fn run_cache_key_command(options: CacheKeyOptions<'_>) -> Result<(), Box<dyn Err
22912294
expect_namespace,
22922295
expect_key_namespace,
22932296
expect_user_tag,
2297+
expect_peer_fill_enabled,
2298+
expect_peer_fill_peers,
2299+
expect_peer_fill_max_concurrent_requests,
22942300
);
22952301
Err("cache-key requires the proxy and cache features".into())
22962302
}
@@ -2333,6 +2339,9 @@ fn run_cache_lookup_command(
23332339
expect_user_tag,
23342340
expect_serve_stale_if_error,
23352341
expect_serve_stale_while_revalidate,
2342+
expect_peer_fill_enabled,
2343+
expect_peer_fill_peers,
2344+
expect_peer_fill_max_concurrent_requests,
23362345
} = options;
23372346
let _ = (config_path, host, headers, method, path, query);
23382347
let _ = (
@@ -2363,6 +2372,9 @@ fn run_cache_lookup_command(
23632372
expect_user_tag,
23642373
expect_serve_stale_if_error,
23652374
expect_serve_stale_while_revalidate,
2375+
expect_peer_fill_enabled,
2376+
expect_peer_fill_peers,
2377+
expect_peer_fill_max_concurrent_requests,
23662378
);
23672379
Err("cache-lookup requires the proxy and cache features".into())
23682380
}

src/config.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7382,14 +7382,15 @@ mod tests {
73827382
use super::{
73837383
AdminConfig, AdminHealthConfig, AdminHealthResponseMode, AdminRemoteTransportMode,
73847384
AdminSelfHealingConfig, AdminTransportConfig, ByteSize, CacheConfig, CacheDiskBackend,
7385-
CacheDiskEncryptionProvider, CacheKeyPart, CachePeerConfig, CachePeerFillConfig,
7386-
CachePurgerConfig, CacheStaleErrorKind, Config, ConfigError, ConfigLoadError,
7387-
HeaderPolicyConfig, LoggingConfig, MetricsConfig, ProxyConfig, ServerConfig,
7388-
ServerLimitsConfig, StaticCertificateConfig, TlsAlpnPolicy, TlsCipherSuite,
7389-
TlsCurvePreference, TlsPolicyProfile, TlsProtocolVersion, TracingConfig, VhostConfig,
7390-
VhostHeaderPolicyConfig, VhostTlsConfig, WebConfig, normalize_host, normalize_host_pattern,
7391-
valid_dynamic_header_variable, validate_dynamic_header_template,
7385+
CacheDiskEncryptionProvider, CacheKeyPart, CachePurgerConfig, CacheStaleErrorKind, Config,
7386+
ConfigError, ConfigLoadError, HeaderPolicyConfig, LoggingConfig, MetricsConfig,
7387+
ProxyConfig, ServerConfig, ServerLimitsConfig, StaticCertificateConfig, TlsAlpnPolicy,
7388+
TlsCipherSuite, TlsCurvePreference, TlsPolicyProfile, TlsProtocolVersion, TracingConfig,
7389+
VhostConfig, VhostHeaderPolicyConfig, VhostTlsConfig, WebConfig, normalize_host,
7390+
normalize_host_pattern, valid_dynamic_header_variable, validate_dynamic_header_template,
73927391
};
7392+
#[cfg(feature = "cache")]
7393+
use super::{CachePeerConfig, CachePeerFillConfig};
73937394
use crate::test_support::{safe_child_path, safe_relative_path, unique_temp_path};
73947395
#[cfg(unix)]
73957396
use crate::test_support::{unique_group_writable_child, unique_world_writable_child};
@@ -9820,6 +9821,7 @@ mod tests {
98209821
}
98219822

98229823
#[test]
9824+
#[cfg(feature = "cache")]
98239825
fn rejects_cache_peer_fill_without_enabled_cache_policy() {
98249826
let config: Config = toml::from_str(
98259827
r#"
@@ -9844,6 +9846,7 @@ mod tests {
98449846
}
98459847

98469848
#[test]
9849+
#[cfg(feature = "cache")]
98479850
fn rejects_unsafe_cache_peer_fill_peers() {
98489851
let config: Config = toml::from_str(
98499852
r#"

0 commit comments

Comments
 (0)