test(hmac): cover label/spec/kid accessors and jwk use field across all specs#700
Conversation
…ll specs Adds 5 tests to `crates/uselesskey-hmac/tests/accessors.rs` that close coverage gaps where existing tests only exercised one HmacSpec variant (usually HS512): - `label`/`spec`/`secret_bytes()` accessors validated for HS256, HS384, HS512 with their expected byte lengths (32/48/64) - `Clone` on `HmacSecret` preserves label, spec, and secret_bytes for every variant - JWK `use` field is "sig" across all specs (only HS512 was checked) - `kid()` is deterministic across separate factories for HS256/HS384/HS512 (only HS256 was previously verified) - `kid()` differs across specs for the same label, reflecting that the spec is part of the cache identity and the kid is derived from secret bytes whose length differs by spec No production code changes. Tests use `Factory::deterministic_from_str` and avoid `.expect()`/`.unwrap()` so no new no-panic-family debt. https://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD
|
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
Closes accessor-coverage gaps in
uselesskey-hmacwhere existing tests only exercised oneHmacSpecvariant. No production code changes.Gaps closed
label()/spec()accessors per variantaccessors_round_trip_for_all_specssecret_bytes().len()per variantCloneonHmacSecretcloned_secret_preserves_bytes_and_accessors_for_all_specsuse = "sig"per variantjwk_use_field_is_sig_for_all_specskid()determinism per variantkid_is_deterministic) verified that two factories produced the same kid; HS384 and HS512 were untestedkid_is_deterministic_for_all_specskid()distinctness across specskid_differs_across_specs_for_same_label5 new tests, gated on
#[cfg(feature = "jwk")]where appropriate. All tests useFactory::deterministic_from_strand avoid.expect()/.unwrap(), keeping the no-panic-family check at zero new debt.Test plan
cargo test -p uselesskey-hmac --test accessors— 3/3 pass (default features)cargo test -p uselesskey-hmac --test accessors --features jwk— 6/6 passcargo clippy -p uselesskey-hmac --tests --all-features -- -D warningscargo xtask check-no-panic-family— only the pre-existingxtask/src/user_path_smoke.rs:126debt remainscargo fmt --check -p uselesskey-hmachttps://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD
Generated by Claude Code