test(rsa): cover JWK output and kid across all RSA spec sizes#740
Conversation
Adds 9 tests in `crates/uselesskey-rsa/tests/jwk_cross_spec.rs` that close JWK coverage gaps where existing tests only exercised RS256 (2048-bit): - `public_key_jwk` alias equivalence across RS256/RS384/RS512. - `public_jwk_json` / `public_jwks_json` / `private_key_jwk_json` consistency with `to_value()` across all spec sizes. - JWKS-embedded key equals standalone `public_jwk()` for non-RS256 specs. - `kid()` stability across separate `Factory` instances seeded with the same string, for every supported bit size. - `kid()` distinctness across different specs sharing the same label (spec is part of cache identity, so the derivation differs by bits). - `jwk_alg()` falls back to RS256 for sizes outside the RS384/RS512 match arms (1024-bit, which the existing match-arm tests never reach). - `public_jwk["use"]` / `private_key_jwk["use"]` are "sig" across all specs (only RS256 was verified by `mutation_hardening`). No production code changes. Tests use `Factory::deterministic_from_str` and avoid `.expect()`/`.unwrap()` so no new no-panic-family debt is added. https://claude.ai/code/session_0116SGvHnLaoXXd6wz2U9SvM
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Adds 9 tests in a new file
crates/uselesskey-rsa/tests/jwk_cross_spec.rsthat close JWK /
kidcoverage gaps where existing tests only exercisedRS256 (2048-bit). Closes the matrix across RS256 / RS384 / RS512 plus the
1024-bit fallback that previously had no JWK assertions.
Gaps closed:
public_key_jwkalias equivalence withpublic_jwkacross RS256/RS384/RS512.public_jwk_json/public_jwks_json/private_key_jwk_jsonconsistency with
to_value()across all spec sizes (previously onlythe RS256 path was checked in
rsa_prop).public_jwk()for non-RS256 specs.kid()stability across separateFactoryinstances seeded withthe same string, for every supported bit size (existing tests only
reused one factory).
kid()distinctness across different specs for the same label(spec is part of cache identity, so the RSA derivation differs by bits).
jwk_alg()falls back to RS256 for sizes outside the RS384/RS512match arms (1024-bit, which the existing match-arm tests never reach).
public_jwk["use"]/private_key_jwk["use"]are "sig" across allspecs (only RS256 was verified by
mutation_hardening).No production code changes. The new file is
#[cfg(feature = "jwk")]gated. Tests use
Factory::deterministic_from_strand avoid.expect()/.unwrap()so no new no-panic-family debt is added(
cargo xtask check-no-panic-familyshows the same 3 unrelated x509sites as on
origin/main).Test plan
cargo test -p uselesskey-rsa --all-features --test jwk_cross_spec(9 passed)cargo test -p uselesskey-rsa --all-features(full suite green)cargo clippy -p uselesskey-rsa --all-targets --all-features -- -D warningscargo fmt -p uselesskey-rsa --checkcargo xtask check-no-panic-family— no new debt attributable to this PRhttps://claude.ai/code/session_0116SGvHnLaoXXd6wz2U9SvM
Generated by Claude Code