Skip to content

test(rsa): cover JWK output and kid across all RSA spec sizes#740

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/cover-rsa-jwk-cross-spec
May 16, 2026
Merged

test(rsa): cover JWK output and kid across all RSA spec sizes#740
EffortlessSteven merged 1 commit into
mainfrom
claude/cover-rsa-jwk-cross-spec

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Adds 9 tests in a new file crates/uselesskey-rsa/tests/jwk_cross_spec.rs
that close JWK / kid coverage gaps where existing tests only exercised
RS256 (2048-bit). Closes the matrix across RS256 / RS384 / RS512 plus the
1024-bit fallback that previously had no JWK assertions.

Gaps closed:

  • public_key_jwk alias equivalence with public_jwk across RS256/RS384/RS512.
  • public_jwk_json / public_jwks_json / private_key_jwk_json
    consistency with to_value() across all spec sizes (previously only
    the RS256 path was checked in rsa_prop).
  • 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 (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/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. The new file is #[cfg(feature = "jwk")]
gated. Tests use Factory::deterministic_from_str and avoid
.expect() / .unwrap() so no new no-panic-family debt is added
(cargo xtask check-no-panic-family shows the same 3 unrelated x509
sites 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 warnings
  • cargo fmt -p uselesskey-rsa --check
  • cargo xtask check-no-panic-family — no new debt attributable to this PR

https://claude.ai/code/session_0116SGvHnLaoXXd6wz2U9SvM


Generated by Claude Code

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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 32 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8543d174-ea8c-4970-865a-8e28c52c3289

📥 Commits

Reviewing files that changed from the base of the PR and between ac9aba2 and bcf489a.

📒 Files selected for processing (1)
  • crates/uselesskey-rsa/tests/jwk_cross_spec.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/cover-rsa-jwk-cross-spec

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven marked this pull request as ready for review May 16, 2026 09:43
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit 22099af into main May 16, 2026
6 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.

2 participants