Skip to content

Commit f52e5b5

Browse files
phlaxnshipilov
authored andcommitted
deps/rust: Bump rust -> 1.88 (and resolve time vuln) (#44309)
Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: Nick Shipilov <nick.shipilov.n@gmail.com>
1 parent 24a5371 commit f52e5b5

11 files changed

Lines changed: 29 additions & 46 deletions

File tree

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/dependency_imports.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def envoy_dependency_imports(
6565
)
6666
rules_rust_dependencies()
6767
rust_register_toolchains(
68-
versions = ["1.86.0"],
68+
versions = ["1.88.0"],
6969
extra_target_triples = [
7070
"wasm32-unknown-unknown",
7171
"wasm32-wasi",

source/extensions/dynamic_modules/builtin_extensions/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ envoy-proxy-dynamic-modules-rust-sdk = { path = "../sdk/rust" }
1212
hickory-resolver = { version = "0.25", features = ["system-config", "tokio", "tls-ring", "https-ring", "dnssec-ring", "webpki-roots"] }
1313
serde = { version = "1", features = ["derive"] }
1414
serde_json = "1"
15+
time = ">=0.3.47"
1516
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
1617
url = "2"
1718

18-
# Pin time to a version compatible with stable Rust.
19-
time = ">=0.3.0, <0.3.37"
20-
2119
[lib]
2220
name = "envoy_dynamic_modules_builtin_extensions"
2321
path = "lib.rs"

test/extensions/dynamic_modules/test_data/rust/bootstrap_admin_handler_test.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ impl BootstrapExtensionConfig for AdminHandlerTestBootstrapExtensionConfig {
5353
envoy_log_info!("Admin request received: {} {}", method, path);
5454
(
5555
200,
56-
format!(
57-
"Hello from dynamic module admin handler! method={} path={}",
58-
method, path
59-
),
56+
format!("Hello from dynamic module admin handler! method={method} path={path}"),
6057
)
6158
}
6259
}

test/extensions/dynamic_modules/test_data/rust/bootstrap_http_combined_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for CombinedHttpFilter {
242242
envoy_filter.send_response(
243243
503,
244244
&[("x-error-reason", b"service_not_onboarded")],
245-
Some(format!("service '{}' is not onboarded", svc).as_bytes()),
245+
Some(format!("service '{svc}' is not onboarded").as_bytes()),
246246
Some("service_not_onboarded"),
247247
);
248248
abi::envoy_dynamic_module_type_on_http_filter_request_headers_status::StopIteration

test/extensions/dynamic_modules/test_data/rust/bootstrap_timer_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl BootstrapExtensionConfig for TimerTestBootstrapExtensionConfig {
105105
let mut guard = self.timer_b.lock().unwrap();
106106
*guard = None;
107107
} else {
108-
panic!("Unknown timer fired with id: {}", fired_id);
108+
panic!("Unknown timer fired with id: {fired_id}");
109109
}
110110

111111
// Signal init complete and log success once both timers have fired.

test/extensions/dynamic_modules/test_data/rust/http.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn new_http_filter_config_fn<EC: EnvoyHttpFilterConfig, EHF: EnvoyHttpFilter>(
4949
"typed_filter_state_callbacks" => Some(Box::new(TypedFilterStateCallbacksFilterConfig {})),
5050
"body_callbacks" => Some(Box::new(BodyCallbacksFilterConfig {})),
5151
"config_init_failure" => None,
52-
_ => panic!("Unknown filter name: {}", name),
52+
_ => panic!("Unknown filter name: {name}"),
5353
}
5454
}
5555

@@ -1065,29 +1065,17 @@ impl<EHF: EnvoyHttpFilter> std::io::Write for BodyWriter<'_, EHF> {
10651065
if self.request {
10661066
if self.received {
10671067
if !self.envoy_filter.append_received_request_body(buf) {
1068-
return Err(std::io::Error::new(
1069-
std::io::ErrorKind::Other,
1070-
"Buffer is not available",
1071-
));
1068+
return Err(std::io::Error::other("Buffer is not available"));
10721069
}
10731070
} else if !self.envoy_filter.append_buffered_request_body(buf) {
1074-
return Err(std::io::Error::new(
1075-
std::io::ErrorKind::Other,
1076-
"Buffer is not available",
1077-
));
1071+
return Err(std::io::Error::other("Buffer is not available"));
10781072
}
10791073
} else if self.received {
10801074
if !self.envoy_filter.append_received_response_body(buf) {
1081-
return Err(std::io::Error::new(
1082-
std::io::ErrorKind::Other,
1083-
"Buffer is not available",
1084-
));
1075+
return Err(std::io::Error::other("Buffer is not available"));
10851076
}
10861077
} else if !self.envoy_filter.append_buffered_response_body(buf) {
1087-
return Err(std::io::Error::new(
1088-
std::io::ErrorKind::Other,
1089-
"Buffer is not available",
1090-
));
1078+
return Err(std::io::Error::other("Buffer is not available"));
10911079
}
10921080

10931081
Ok(buf.len())

test/extensions/dynamic_modules/test_data/rust/http_integration_test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn new_http_filter_config_fn<EC: EnvoyHttpFilterConfig, EHF: EnvoyHttpFilter>(
136136
Some(Box::new(ConfigStreamConfig { stream_done }))
137137
},
138138
"list_metadata_callbacks" => Some(Box::new(ListMetadataCallbacksFilterConfig {})),
139-
_ => panic!("Unknown filter name: {}", name),
139+
_ => panic!("Unknown filter name: {name}"),
140140
}
141141
}
142142

@@ -145,7 +145,7 @@ fn new_http_filter_per_route_config_fn(name: &str, config: &[u8]) -> Option<Box<
145145
"per_route_config" => Some(Box::new(PerRoutePerRouteFilterConfig {
146146
value: String::from_utf8(config.to_owned()).unwrap(),
147147
})),
148-
_ => panic!("Unknown filter name: {}", name),
148+
_ => panic!("Unknown filter name: {name}"),
149149
}
150150
}
151151

@@ -787,7 +787,7 @@ impl SendResponseHttpFilterConfig {
787787
b"on_request_headers" => SendResponseHttpFilter::RequestHeader,
788788
b"on_request_body" => SendResponseHttpFilter::RequestBody,
789789
b"on_response_headers" => SendResponseHttpFilter::ResponseHeader,
790-
_ => panic!("Unknown filter name: {:?}", config),
790+
_ => panic!("Unknown filter name: {config:?}"),
791791
};
792792
Self { f }
793793
}
@@ -1895,7 +1895,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for ListMetadataCallbacksFilter {
18951895
let val = envoy_filter
18961896
.get_metadata_list_number(source, "ns", "numbers", i)
18971897
.unwrap();
1898-
let header_name = format!("x-list-num-{}", i);
1898+
let header_name = format!("x-list-num-{i}");
18991899
envoy_filter.set_response_header(&header_name, (val as i64).to_string().as_bytes());
19001900
}
19011901

@@ -1909,7 +1909,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for ListMetadataCallbacksFilter {
19091909
.get_metadata_list_string(source, "ns", "strings", i)
19101910
.unwrap();
19111911
let val_bytes = val.as_slice().to_vec();
1912-
let header_name = format!("x-list-str-{}", i);
1912+
let header_name = format!("x-list-str-{i}");
19131913
envoy_filter.set_response_header(&header_name, &val_bytes);
19141914
}
19151915

@@ -1922,7 +1922,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for ListMetadataCallbacksFilter {
19221922
let val = envoy_filter
19231923
.get_metadata_list_bool(source, "ns", "bools", i)
19241924
.unwrap();
1925-
let header_name = format!("x-list-bool-{}", i);
1925+
let header_name = format!("x-list-bool-{i}");
19261926
envoy_filter.set_response_header(&header_name, val.to_string().as_bytes());
19271927
}
19281928

test/extensions/dynamic_modules/test_data/rust/http_stream_callouts_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn new_http_filter_config_fn<EC: EnvoyHttpFilterConfig, EHF: EnvoyHttpFilter>(
3232
"upstream_reset" => Some(Box::new(UpstreamResetConfig {
3333
cluster_name: String::from_utf8(config.to_owned()).unwrap(),
3434
})),
35-
_ => panic!("Unknown filter name: {}", name),
35+
_ => panic!("Unknown filter name: {name}"),
3636
}
3737
}
3838

@@ -263,7 +263,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for MultipleStreamsFilter {
263263
) -> envoy_dynamic_module_type_on_http_filter_request_headers_status {
264264
// Create 3 concurrent streams.
265265
for i in 1..=3 {
266-
let path = format!("/stream{}", i);
266+
let path = format!("/stream{i}");
267267
let (result, handle) = envoy_filter.start_http_stream(
268268
&self.cluster_name,
269269
&[

test/extensions/dynamic_modules/test_data/rust/network_integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn new_network_filter_config_fn<EC: EnvoyNetworkFilterConfig, ENF: EnvoyNetworkF
2020
"connection_state" => Some(Box::new(ConnectionStateFilterConfig)),
2121
"half_close" => Some(Box::new(HalfCloseFilterConfig)),
2222
"buffer_limits" => Some(Box::new(BufferLimitsFilterConfig)),
23-
_ => panic!("unknown filter name: {}", name),
23+
_ => panic!("unknown filter name: {name}"),
2424
}
2525
}
2626

0 commit comments

Comments
 (0)