Skip to content

Commit a2a8712

Browse files
authored
Merge pull request #12017 from rust-lang/renovate/jsonwebtoken-10.x
Update Rust crate jsonwebtoken to v10
2 parents 296eeda + 8f8188f commit a2a8712

File tree

5 files changed

+21
-34
lines changed

5 files changed

+21
-34
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ claims = "=0.8.0"
161161
diesel = { version = "=2.3.3", features = ["r2d2"] }
162162
googletest = "=0.14.2"
163163
insta = { version = "=1.43.2", features = ["glob", "json", "redactions"] }
164-
jsonwebtoken = "=9.3.1"
164+
jsonwebtoken = { version = "=10.1.0", features = ["aws_lc_rs"] }
165165
quoted_printable = "=0.5.1"
166166
regex = "=1.12.2"
167167
sentry = { version = "=0.45.0", features = ["test"] }

crates/crates_io_trustpub/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ anyhow = "=1.0.100"
1515
async-trait = "=0.1.89"
1616
bon = { version = "=3.8.1", optional = true }
1717
chrono = { version = "=0.4.42", features = ["serde"] }
18-
jsonwebtoken = "=9.3.1"
18+
jsonwebtoken = { version = "=10.1.0", features = ["aws_lc_rs"] }
1919
mockall = { version = "=0.13.1", optional = true }
2020
rand = "=0.9.2"
2121
reqwest = { version = "=0.12.24", features = ["gzip", "json"] }

crates/crates_io_trustpub/src/unverified.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,6 @@
1+
use jsonwebtoken::TokenData;
12
use jsonwebtoken::errors::Error;
2-
use jsonwebtoken::{DecodingKey, TokenData, Validation};
33
use serde::Deserialize;
4-
use std::collections::HashSet;
5-
use std::sync::LazyLock;
6-
7-
/// [`Validation`] configuration for decoding JWTs without any
8-
/// signature validation.
9-
///
10-
/// **This must only be used to extract the `iss` claim from the JWT, which
11-
/// is then used to look up the corresponding OIDC key set.**
12-
static NO_VALIDATION: LazyLock<Validation> = LazyLock::new(|| {
13-
let mut no_validation = Validation::default();
14-
no_validation.validate_aud = false;
15-
no_validation.validate_exp = false;
16-
no_validation.required_spec_claims = HashSet::new();
17-
no_validation.insecure_disable_signature_validation();
18-
no_validation
19-
});
20-
21-
/// Empty [`DecodingKey`] used for decoding JWTs without any signature
22-
/// validation.
23-
///
24-
/// **This must only be used to extract the `iss` claim from the JWT, which
25-
/// is then used to look up the corresponding OIDC key set.**
26-
static EMPTY_KEY: LazyLock<DecodingKey> = LazyLock::new(|| DecodingKey::from_secret(b""));
274

285
/// Claims that are extracted from the JWT without any signature
296
/// validation. Specifically, this only extracts the `iss` claim, which is
@@ -41,7 +18,7 @@ impl UnverifiedClaims {
4118
/// **This must only be used to extract the `iss` claim from the JWT, which
4219
/// is then used to look up the corresponding OIDC key set.**
4320
pub fn decode(token: &str) -> Result<TokenData<Self>, Error> {
44-
jsonwebtoken::decode(token, &EMPTY_KEY, &NO_VALIDATION)
21+
jsonwebtoken::dangerous::insecure_decode(token)
4522
}
4623
}
4724

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ allow = [
108108
"ISC",
109109
"MIT",
110110
"MPL-2.0",
111+
"OpenSSL",
111112
"Unicode-3.0",
112113
"Zlib",
113114
]

0 commit comments

Comments
 (0)