You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(keys): borrow key material instead of cloning on every encode/decode #121
EncodingKeyMaterial::encoding_key() and DecodingKeyMaterial::decoding_key() return self.key.clone() (rust/src/keys.rs:166, rust/src/keys.rs:189), and jsonwebtoken's verifier/signer factory clones the key again into a Box. For RSA that is two ~1.2 KB DER heap copies per call; for HMAC it also leaves non-zeroized copies of the secret behind (only the intermediate buffer is Zeroizing).
Proposal
Mark EncodingKey / DecodingKey as #[pyclass(frozen)], borrow via Bound::get() (no PyRef borrow-flag check), and pass &Jwt*Key into py.detach instead of an owned clone. Combines naturally with the cached-parsed-key work (#120).
Acceptance criteria
No key clone on the encode / decode / decode_verified_complete hot paths when a prebuilt key object is passed
Activity
Merge pull request #127 from QueryaHub/issue/121-borrow-keys
ZhuchkaTriplesix commentedon Sep 28, 2026
Fixed in #127 (merged to dev).