Skip to content

Upgrade to axum 0.8 + tower-http 0.6, accept float NumericDate, add Validation::validate_aud(bool)#66

Open
georgeboot wants to merge 5 commits into
cduvray:mainfrom
georgeboot:disable-aud-check
Open

Upgrade to axum 0.8 + tower-http 0.6, accept float NumericDate, add Validation::validate_aud(bool)#66
georgeboot wants to merge 5 commits into
cduvray:mainfrom
georgeboot:disable-aud-check

Conversation

@georgeboot

@georgeboot georgeboot commented May 28, 2026

Copy link
Copy Markdown

Summary

Four independent changes bundled together:

  • axum 0.8 upgrade. Bumps axum to 0.8.1 in both jwt-authorizer and demo-server, drops #[async_trait]. Adds an OptionalFromRequestParts impl for JwtClaims<T> since axum 0.8 removed the blanket Option<T> extractor impl.
  • NumericDate accepts floats. Some issuers emit exp/nbf/iat as floating-point JSON numbers. RFC 7519 §2 allows it, so deserialize via an untagged enum and cast to i64.
  • Validation::validate_aud(bool). New builder method that disables the aud check entirely. Useful when you trust the issuer and don't want to maintain an allowlist of client IDs.
  • tower-http 0.5 → 0.6. Small dep cleanup — 0.5 still pulls base64 0.21, so downstreams that have moved on to 0.22 via other paths end up carrying two copies. No API changes affect this crate (we only use the trace + auth features).

We've been running these changes in our own fork for more than a year, and figured we should just try to get them upstreamed.

Test plan

  • cargo build --all-features
  • cargo test --all-features (49 passed, including new extract_from_public_optional, numeric_date_accepts_int_and_float, validate_aud_disabled)

georgeboot and others added 5 commits November 12, 2024 11:21
Mirrors jsonwebtoken's own validate_aud toggle. When set to false the aud
claim is ignored even if present, so callers don't need to maintain an
allowlist of client IDs when the issuer is the only thing they care about.
- Add OptionalFromRequestParts impl for JwtClaims so Option<JwtClaims<T>>
  extraction works under axum 0.8 (blanket impl was removed), and restore
  the extract_from_public_optional test.
- Drop dead #[allow(dead_code)] and unused serde::de::Error import from
  the NumericDate deserializer.
- Add tests for NumericDate int/float deserialization and for
  Validation::validate_aud(false).
- CHANGELOG entries for the three new features on this branch.
tower-http 0.5 still pulls base64 0.21, which causes duplication for
downstreams that have moved on to base64 0.22 via more modern http-stack
crates. 0.6 went out in October 2024 with no API breakage that affects
our usage (we only use the `trace` + `auth` features). All 14 unit
tests + 3 doctests pass unchanged.
@georgeboot georgeboot changed the title Upgrade to axum 0.8, accept float NumericDate, add Validation::validate_aud(bool) Upgrade to axum 0.8 + tower-http 0.6, accept float NumericDate, add Validation::validate_aud(bool) May 28, 2026
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.

2 participants