Repository navigation
deps: bump jsonwebtoken to 12 - #156
Merged
Merged
Conversation
jsonwebtoken 12 makes EncodingKey::from_secret and DecodingKey::from_secret return a Result and reject an empty HMAC key. Propagate the error with context in oauth_as/jwt.rs sign and verify, and handle it in the assertion test. Also refresh the lockfile with cargo update for serde_json, rand, sha2, open, uuid and libc, plus what jsonwebtoken 12 pulls in (signature 3.0.0, rand_core 0.6 dropped). regex was already at its latest release. url, rustix and form_urlencoded are untouched. Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
jsonwebtoken 12 changes
EncodingKey::from_secretandDecodingKey::from_secretto returnResult, rejecting an empty HMAC key.from_ec_derstill returns the key directly,DecodingKey::from_jwkwas already aResult, anddangerous::insecure_decode_claimsstill exists (checked in the 12.0.0 source).Cargo.toml:jsonwebtoken11 -> 12, keepingdefault-features = falseandaws_lc_rs.src/server_auth/oauth_as/jwt.rs:signandverifypropagate the new error with context (invalid JWT signing secret,invalid JWT verification secret). No unwrap in library code.src/server_auth/oauth_as/assertion.rs: the HS256 test token uses.expect("test secret is non-empty").Cargo.lock: refreshed withcargo update, no hand edits.Lockfile bumps: jsonwebtoken 11.1.0 -> 12.0.0, serde_json 1.0.152 -> 1.0.154, sha2 0.11.0 -> 0.11.1, rand 0.10.3 -> 0.10.4, open 5.4.4 -> 5.4.5, uuid 1.28.0 -> 1.29.3, libc 0.2.189 -> 0.2.191. regex was already at its latest release. Pulled in by jsonwebtoken 12: signature 2.2.0 -> 3.0.0, and rand_core 0.6.4 is dropped. url, rustix, form_urlencoded and the chrono ignore in deny.toml from #155 are unchanged.
The new dependency versions need a newer Rust than the toolchain I had (see below): jsonwebtoken 12 and sha2 0.11.1 need 1.88, uuid 1.29.3 needs 1.89.
Supersedes #154.
Testing
I could not build or test this change. The sandbox has rustc 1.85.1 and no rustup, and the lockfile now needs a newer compiler.
cargo test: not run (same toolchain error). No pass/fail counts to report.cargo clippy -- -D warnings: not run (same reason).cargo fmt --check: not run, rustfmt is not installed. I kept new lines under 100 columns by hand.cargo deny check advisories: not run, cargo-deny is not installed.What I did verify: the 12.0.0 source in the cargo registry shows
from_secretreturningResultin both encoding.rs and decoding.rs,from_ec_derreturningSelf, anddangerous::insecure_decode_claimsre-exported. Agrepshows jwt.rs and the one assertion.rs test are the onlyfrom_secretcall sites. CI on this PR needs a toolchain of 1.89 or newer to be the real check.Testes: Not run. rustc 1.85.1 cannot build the updated lockfile (jsonwebtoken 12 and sha2 0.11.1 need 1.88, uuid 1.29.3 needs 1.89). cargo build/test/clippy failed or were skipped for that reason; rustfmt and cargo-deny are not installed. Source adaptation checked only by reading jsonwebtoken 12.0.0 source.