Skip to content

perf(jwt): prebuild DecodingKey and Validation per route - #132

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-109-jwt-prebuild
Jul 20, 2026
Merged

perf(jwt): prebuild DecodingKey and Validation per route#132
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-109-jwt-prebuild

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • Prebuild DecodingKey + Validation at route registration (build_route_jwt_state)
  • Hot path reuses Arc handles — no per-request Validation::new / key rebuild
  • Behaviour unchanged (iss/aud/leeway/cookie/HS*/RS* covered by existing tests)

Closes #109

Test plan

  • make test or focused JWT suite: pytest tests/test_jwt_*.py
  • cargo clippy --all-targets -- -D warnings
  • Spot-check expired / wrong-alg / cookie JWT still 401 as before

Build JWT verification state once at add_route and reuse Arc handles on
the hot path instead of reconstructing Validation/DecodingKey per request.
Closes #109.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit ae16597 into dev Jul 20, 2026
16 checks passed
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