8000 deps: bump jsonwebtoken to 12 by avelino · Pull Request #156 · avelino/mcp · GitHub
[go: up one dir, main page]

Skip to content

deps: bump jsonwebtoken to 12 - #156

Merged
avelino merged 1 commit into
mainfrom
avelino/chore/jsonwebtoken-12
Nov 24, 2026
Merged

avelino merged 1 commit into
mainfrom
avelino/chore/jsonwebtoken-12

Conversation

@avelino
@avelino avelino commented Nov 24, 2026
Copy link
Copy Markdown
Owner

What changed

jsonwebtoken 12 changes EncodingKey::from_secret and DecodingKey::from_secret to return Result, rejecting an empty HMAC key. from_ec_der still returns the key directly, DecodingKey::from_jwk was already a Result, and dangerous::insecure_decode_claims still exists (checked in the 12.0.0 source).

  • Cargo.toml: jsonwebtoken 11 -> 12, keeping default-features = false and aws_lc_rs.
  • src/server_auth/oauth_as/jwt.rs: sign and verify propagate 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 with cargo 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.

$ rustc --version && cargo --version
rustc 1.85.1 (4eb161250 2025-03-15)
cargo 1.85.1 (d73d2caf9 2024-12-31)

$ cargo build
error: rustc 1.85.1 is not supported by the following packages:
  jsonwebtoken@12.0.0 requires rustc 1.88.0
  sha2@0.11.1 requires rustc 1.88
  tonic@0.14.6 requires rustc 1.88
  uuid@1.29.3 requires rustc 1.89.0
  (plus icu_* / idna_adapter requiring 1.86)
  • 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.
  • Docker: not run.

What I did verify: the 12.0.0 source in the cargo registry shows from_secret returning Result in both encoding.rs and decoding.rs, from_ec_der returning Self, and dangerous::insecure_decode_claims re-exported. A grep shows jwt.rs and the one assertion.rs test are the only from_secret call 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.

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>
@avelino
avelino merged commit 7d07c79 into main Nov 24, 2026
7 checks passed
@avelino
avelino deleted the avelino/chore/jsonwebtoken-12 branch November 24, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0