Skip to content

docs: add webhook signature validation how-to#594

Merged
EffortlessSteven merged 1 commit into
mainfrom
docs/howto-webhook-signature
May 12, 2026
Merged

docs: add webhook signature validation how-to#594
EffortlessSteven merged 1 commit into
mainfrom
docs/howto-webhook-signature

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Pure docs PR. Task-first how-to for webhook signature validation. Part of the Phase 4 task-first user-paths sweep.

  • Adds docs/how-to/test-webhook-signature-validation.md walking through the uselesskey-webhook surface: generating a deterministic provider-style fixture (fx.webhook_stripe, fx.webhook_github, fx.webhook_slack), verifying it in a downstream consumer with the per-provider base string, and driving the three near-miss negatives (StaleTimestamp, WrongSecret, TamperedPayload).
  • Code snippets match the actual public API in crates/uselesskey-webhook/src/lib.rsWebhookFactoryExt, WebhookFixture { secret, payload, headers, timestamp, signature_input }, and the near_miss_* constructors. No new APIs are invented.
  • Honest about scope: scanner-safety boundary noted, replay-protection responsibilities left to the consumer, no false claims about delivery semantics or production crypto.

Files added

  • docs/how-to/test-webhook-signature-validation.md

Test plan

  • cargo xtask docs-sync --check
  • cargo xtask typos
  • git diff --check
  • CI passes on the PR

Task-first how-to covering the uselesskey-webhook surface: how to
generate a deterministic provider-style webhook fixture
(GitHub/Stripe/Slack), how to verify it in a downstream consumer, and
how to drive the three near-miss negatives (stale timestamp, wrong
secret, tampered payload). Part of the Phase 4 task-first user-paths
sweep.
@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 12, 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 6 minutes and 28 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: 2f7cb75c-6274-45b6-8918-7b67ac1a9437

📥 Commits

Reviewing files that changed from the base of the PR and between e1f2f0a and 6ad9ad5.

📒 Files selected for processing (1)
  • docs/how-to/test-webhook-signature-validation.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/howto-webhook-signature

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ad9ad5a31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +90 to +91
let expected = hex::encode(mac.finalize().into_bytes());
v1 == Some(expected.as_str())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a constant-time signature comparison

This verifier is presented as recomputing the HMAC and comparing it “in constant time,” but the sample uses ordinary string equality, which can short-circuit based on matching prefixes. Because this guide is for webhook verification code that users may copy into consumers, the example should use a constant-time equality primitive such as subtle::ConstantTimeEq or hmac::Mac::verify_slice after decoding the header digest.

Useful? React with 👍 / 👎.

@EffortlessSteven EffortlessSteven merged commit 4e92910 into main May 12, 2026
5 checks passed
@EffortlessSteven EffortlessSteven mentioned this pull request May 12, 2026
4 tasks
EffortlessSteven added a commit that referenced this pull request May 12, 2026
TLS contract-pack and public crate-surface cleanup release. Bumps
workspace to 0.8.0. CHANGELOG entry curated from merged PRs:
#485-#605 (TLS lane #585/#587/#588/#589, task-first how-tos
#590-#594, SRP collapse #595/#598/#599/#602, migration guide #603,
Clippy ratchets #505, dep bumps #484-#491).
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.

1 participant