Skip to content

Commit 50ba196

Browse files
authored
chore(deps): Clean up cargo deny exemptions (#4168)
* chore(deps): Clean up cargo deny exemptions The `linkerd-trace-context` package unecessarily used a few outdated dependencies that were keeping some other dependencies locked to old versions. This updates the following dependencies in `linkerd-trace-context` that were already updated in other packages (or unused in general): - `rand` 0.8 -> 0.9 - `thiserror` 1 -> 2 - `base64` 0.13 -> 0.22 The associated `deny.toml` entries have also been removed outright or updated to a narrower exemption. Signed-off-by: Scott Fleener <[email protected]> * fix(clippy): Fix clippy deprecation warnings Signed-off-by: Scott Fleener <[email protected]> --------- Signed-off-by: Scott Fleener <[email protected]>
1 parent d0e956c commit 50ba196

File tree

5 files changed

+32
-62
lines changed

5 files changed

+32
-62
lines changed

Cargo.lock

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,6 @@ dependencies = [
257257
"windows-targets 0.52.6",
258258
]
259259

260-
[[package]]
261-
name = "base64"
262-
version = "0.13.1"
263-
source = "registry+https://github.com/rust-lang/crates.io-index"
264-
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
265-
266260
[[package]]
267261
name = "base64"
268262
version = "0.22.1"
@@ -1073,9 +1067,9 @@ dependencies = [
10731067

10741068
[[package]]
10751069
name = "hyper-util"
1076-
version = "0.1.17"
1070+
version = "0.1.16"
10771071
source = "registry+https://github.com/rust-lang/crates.io-index"
1078-
checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8"
1072+
checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
10791073
dependencies = [
10801074
"bytes",
10811075
"futures-channel",
@@ -1371,7 +1365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
13711365
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
13721366
dependencies = [
13731367
"cfg-if",
1374-
"windows-targets 0.52.6",
1368+
"windows-targets 0.48.5",
13751369
]
13761370

13771371
[[package]]
@@ -2623,15 +2617,15 @@ dependencies = [
26232617
name = "linkerd-trace-context"
26242618
version = "0.1.0"
26252619
dependencies = [
2626-
"base64 0.13.1",
2620+
"base64",
26272621
"bytes",
26282622
"futures",
26292623
"hex",
26302624
"http",
26312625
"linkerd-error",
26322626
"linkerd-stack",
2633-
"rand 0.8.5",
2634-
"thiserror 1.0.69",
2627+
"rand 0.9.2",
2628+
"thiserror 2.0.16",
26352629
"tower",
26362630
"tracing",
26372631
]
@@ -2996,7 +2990,7 @@ version = "0.30.0"
29962990
source = "registry+https://github.com/rust-lang/crates.io-index"
29972991
checksum = "2e046fd7660710fe5a05e8748e70d9058dc15c94ba914e7c4faa7c728f0e8ddc"
29982992
dependencies = [
2999-
"base64 0.22.1",
2993+
"base64",
30002994
"hex",
30012995
"opentelemetry",
30022996
"opentelemetry_sdk",
@@ -3050,7 +3044,7 @@ version = "3.0.5"
30503044
source = "registry+https://github.com/rust-lang/crates.io-index"
30513045
checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3"
30523046
dependencies = [
3053-
"base64 0.22.1",
3047+
"base64",
30543048
"serde",
30553049
]
30563050

@@ -3359,8 +3353,6 @@ version = "0.8.5"
33593353
source = "registry+https://github.com/rust-lang/crates.io-index"
33603354
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
33613355
dependencies = [
3362-
"libc",
3363-
"rand_chacha 0.3.1",
33643356
"rand_core 0.6.4",
33653357
]
33663358

@@ -3370,20 +3362,10 @@ version = "0.9.2"
33703362
source = "registry+https://github.com/rust-lang/crates.io-index"
33713363
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
33723364
dependencies = [
3373-
"rand_chacha 0.9.0",
3365+
"rand_chacha",
33743366
"rand_core 0.9.0",
33753367
]
33763368

3377-
[[package]]
3378-
name = "rand_chacha"
3379-
version = "0.3.1"
3380-
source = "registry+https://github.com/rust-lang/crates.io-index"
3381-
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
3382-
dependencies = [
3383-
"ppv-lite86",
3384-
"rand_core 0.6.4",
3385-
]
3386-
33873369
[[package]]
33883370
name = "rand_chacha"
33893371
version = "0.9.0"
@@ -3472,9 +3454,9 @@ checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
34723454

34733455
[[package]]
34743456
name = "resolv-conf"
3475-
version = "0.7.5"
3457+
version = "0.7.4"
34763458
source = "registry+https://github.com/rust-lang/crates.io-index"
3477-
checksum = "6b3789b30bd25ba102de4beabd95d21ac45b69b1be7d14522bab988c526d6799"
3459+
checksum = "95325155c684b1c89f7765e30bc1c42e4a6da51ca513615660cb8a62ef9a88e3"
34783460

34793461
[[package]]
34803462
name = "ring"
@@ -3623,9 +3605,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
36233605

36243606
[[package]]
36253607
name = "semver"
3626-
version = "1.0.27"
3608+
version = "1.0.26"
36273609
source = "registry+https://github.com/rust-lang/crates.io-index"
3628-
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
3610+
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
36293611

36303612
[[package]]
36313613
name = "serde"
@@ -3659,15 +3641,14 @@ dependencies = [
36593641

36603642
[[package]]
36613643
name = "serde_json"
3662-
version = "1.0.145"
3644+
version = "1.0.143"
36633645
source = "registry+https://github.com/rust-lang/crates.io-index"
3664-
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
3646+
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
36653647
dependencies = [
36663648
"itoa",
36673649
"memchr",
36683650
"ryu",
36693651
"serde",
3670-
"serde_core",
36713652
]
36723653

36733654
[[package]]
@@ -3847,9 +3828,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
38473828

38483829
[[package]]
38493830
name = "tempfile"
3850-
version = "3.22.0"
3831+
version = "3.21.0"
38513832
source = "registry+https://github.com/rust-lang/crates.io-index"
3852-
checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53"
3833+
checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e"
38533834
dependencies = [
38543835
"fastrand",
38553836
"getrandom 0.3.1",
@@ -4092,7 +4073,7 @@ checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9"
40924073
dependencies = [
40934074
"async-trait",
40944075
"axum",
4095-
"base64 0.22.1",
4076+
"base64",
40964077
"bytes",
40974078
"h2",
40984079
"http",
@@ -4268,9 +4249,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
42684249

42694250
[[package]]
42704251
name = "unicode-ident"
4271-
version = "1.0.19"
4252+
version = "1.0.18"
42724253
source = "registry+https://github.com/rust-lang/crates.io-index"
4273-
checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
4254+
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
42744255

42754256
[[package]]
42764257
name = "untrusted"

deny.toml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,16 @@ deny = [
4545
# aws-lc-rs should be used instead.
4646
{ name = "ring" }
4747
]
48-
skip = [
49-
# `linkerd-trace-context`, `rustls-pemfile` and `tonic` depend on `base64`
50-
# v0.13.1 while `rcgen` depends on v0.21.5
51-
{ name = "base64" },
52-
# tonic/axum depend on a newer `tower`, which we are still catching up to.
53-
# see #3744.
54-
{ name = "tower", version = "0.5" },
55-
]
48+
skip = []
5649
skip-tree = [
57-
# thiserror v2 is still propagating through the ecosystem
58-
{ name = "thiserror", version = "1" },
5950
# rand v0.9 is still propagating through the ecosystem
6051
{ name = "rand", version = "0.8" },
61-
# rust v1.0 is still propagating through the ecosystem
62-
{ name = "rustix", version = "0.38" },
6352
# `pprof` uses a number of old dependencies. for now, we skip its subtree.
6453
{ name = "pprof" },
65-
# aws-lc-rs uses a slightly outdated version of bindgen
66-
{ name = "bindgen", version = "0.69.5" },
6754
# socket v0.6 is still propagating through the ecosystem
6855
{ name = "socket2", version = "0.5" },
56+
# zerocopy v0.8 is still propagating through the ecosystem
57+
{ name = "zerocopy", version = "0.7" },
6958
]
7059

7160
[sources]

linkerd/trace-context/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ edition = { workspace = true }
77
publish = { workspace = true }
88

99
[dependencies]
10-
base64 = "0.13"
10+
base64 = "0.22"
1111
bytes = { workspace = true }
1212
futures = { version = "0.3", default-features = false }
1313
hex = "0.4"
1414
http = { workspace = true }
1515
linkerd-error = { path = "../error" }
1616
linkerd-stack = { path = "../stack" }
17-
rand = "0.8"
18-
thiserror = "1"
17+
rand = "0.9"
18+
thiserror = "2"
1919
tower = { workspace = true, default-features = false, features = ["util"] }
2020
tracing = { workspace = true }

linkerd/trace-context/src/propagation/b3.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::propagation::try_split_to;
22
use crate::{Flags, Id};
3+
use base64::Engine;
34
use bytes::Bytes;
45
use http::header::{HeaderName, HeaderValue};
56
use linkerd_error::Error;
6-
use rand::thread_rng;
77

88
use tracing::{debug, trace};
99

@@ -22,7 +22,7 @@ const GRPC_TRACE_FIELD_TRACE_OPTIONS: u8 = 2;
2222
// the `vec![]` macro, despite clippy's suggestions otherwise...
2323
#[allow(clippy::vec_init_then_push)]
2424
pub fn increment_grpc_span_id<B>(request: &mut http::Request<B>, context: &TraceContext) -> Id {
25-
let span_id = Id::new_span_id(&mut thread_rng());
25+
let span_id = Id::new_span_id(&mut rand::rng());
2626

2727
trace!(%span_id, "Incremented span id");
2828

@@ -43,7 +43,7 @@ pub fn increment_grpc_span_id<B>(request: &mut http::Request<B>, context: &Trace
4343
bytes.push(GRPC_TRACE_FIELD_TRACE_OPTIONS);
4444
bytes.push(context.flags.0);
4545

46-
let bytes_b64 = base64::encode(&bytes);
46+
let bytes_b64 = base64::engine::general_purpose::STANDARD.encode(&bytes);
4747

4848
if let Ok(hv) = HeaderValue::from_str(&bytes_b64) {
4949
request.headers_mut().insert(&GRPC_TRACE_HEADER, hv);
@@ -54,7 +54,7 @@ pub fn increment_grpc_span_id<B>(request: &mut http::Request<B>, context: &Trace
5454
}
5555

5656
pub fn increment_http_span_id<B>(request: &mut http::Request<B>) -> Id {
57-
let span_id = Id::new_span_id(&mut thread_rng());
57+
let span_id = Id::new_span_id(&mut rand::rng());
5858

5959
trace!(%span_id, "Incremented span id");
6060

@@ -71,7 +71,7 @@ pub fn increment_http_span_id<B>(request: &mut http::Request<B>) -> Id {
7171
pub fn unpack_grpc_trace_context<B>(request: &http::Request<B>) -> Option<TraceContext> {
7272
get_header_str(request, &GRPC_TRACE_HEADER)
7373
.and_then(|header_str| {
74-
base64::decode(header_str)
74+
base64::engine::general_purpose::STANDARD.decode(header_str)
7575
.map_err(|error| debug!(header = %GRPC_TRACE_HEADER, header_value = %header_str, %error, "Failed to unpack trace context due to invalid base64 encoding"))
7676
.ok()
7777
})

linkerd/trace-context/src/propagation/w3c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn unpack_w3c_trace_context<B>(request: &http::Request<B>) -> Option<TraceCo
1515
/// assign it to the tracecontext header value, in order to propagate
1616
/// the trace context downstream.
1717
pub fn increment_http_span_id<B>(request: &mut http::Request<B>, context: &TraceContext) -> Id {
18-
let span_id = Id::new_span_id(&mut rand::thread_rng());
18+
let span_id = Id::new_span_id(&mut rand::rng());
1919

2020
trace!(%span_id, "Incremented span id");
2121

0 commit comments

Comments
 (0)