test(webhook): cover all profiles for near-miss, raw payloads, hmac key boundaries#696
Conversation
…ey boundaries Adds 10 inline tests to `uselesskey-webhook` that close coverage gaps across previously single-profile-only paths: - `WebhookProfile::stable_tag` for every variant - Raw payload spec returned verbatim and producing a distinct cache identity - `near_miss_stale_timestamp` / `near_miss_wrong_secret` / `near_miss_tampered_payload` validated against GitHub and Slack (Stripe was already covered) - `hmac_sha256_hex` long-key (>64-byte) hashed-first branch (RFC 4231 vector 4) and short-key (<64-byte) zero-padding branch - `Debug` impls verified to redact the secret for all profiles and all near-miss scenarios No production code changes. All tests use `Factory::deterministic_from_str` so the no-panic-family check stays at zero new 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 coverage gaps in
uselesskey-webhookwhere existing tests only exercised one profile (typically Stripe) of a multi-profile code path. No production code changes.Gaps closed
WebhookProfile::stable_tagwebhook_profile_stable_tag_is_unique_per_variantWebhookPayloadSpec::Rawend-to-endcanonical_payload'sRawarm only checked viastable_bytes, never as a generated fixtureraw_payload_spec_is_returned_verbatim,raw_payload_distinct_strings_yield_distinct_cache_identitiesnear_miss_stale_timestampfor GitHub & Slackstale_timestamp_near_miss_works_for_all_profilesnear_miss_wrong_secretfor GitHub & Slackwrong_secret_near_miss_works_for_github_and_slacknear_miss_tampered_payloadfor GitHub & Slacktampered_payload_near_miss_works_for_github_and_slackhmac_sha256_hexlong-key branchhmac_sha256_long_key_is_hashed_first(RFC 4231 vector 4)hmac_sha256_hexshort-key zero-pad branchhmac_sha256_short_key_is_zero_paddedDebugredaction across profilesdebug_redacts_secret_for_all_profilesDebugredaction for all near-miss scenariosWrongSecretcovereddebug_redacts_secret_for_all_near_miss_scenarios10 new tests, all using
Factory::deterministic_from_strto avoid.unwrap()debt. No new no-panic-family debt.Test plan
cargo test -p uselesskey-webhook --lib— 22/22 pass (10 new + 12 existing)cargo clippy -p uselesskey-webhook --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-webhookhttps://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD
Generated by Claude Code