docs: add webhooks documentation (UI and API) [OD-702] - #2758
claudiacodacy wants to merge 5 commits into
Conversation
|
Overall readability score: 54.21 (🟢 +0.01)
View detailed metrics🟢 - Shows an increase in readability
Averages:
View metric targets
|
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The webhook verification documentation allows replay of captured valid deliveries because the timestamp and delivery ID are not covered by the signature and replay handling is not defined. This security gap should be addressed before merging.
The strict MkDocs build and several acceptance criteria remain unverified because no build artifact or automated test evidence is included. Codacy is up to standards; no uncovered complex files were reported.
Test suggestions
- Strict MkDocs build validates the new page and navigation entry without warnings.
- Documentation covers adding, deleting, endpoint limits, permissions, HTTPS validation, and signing-secret lifecycle.
- Documentation accurately describes branch and pull request event payloads and delivery conditions.
- Documentation accurately describes headers, HMAC-SHA256 verification, timeout, retry, and deduplication behavior.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Strict MkDocs build validates the new page and navigation entry without warnings.
2. Documentation covers adding, deleting, endpoint limits, permissions, HTTPS validation, and signing-secret lifecycle.
3. Documentation accurately describes branch and pull request event payloads and delivery conditions.
4. Documentation accurately describes headers, HMAC-SHA256 verification, timeout, retry, and deduplication behavior.
Low confidence findings
- Validate the documented endpoint-management flow against the shipped UI before relying on it as the authoritative guide.
- Add or link automated evidence that
mkdocs build --strictcompletes without warnings.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
|
|
||
| 1. Compute the HMAC-SHA256 hash of the raw request body, using the endpoint's signing secret as the key. | ||
| 1. Hex-encode the hash and prefix it with `sha256=`. | ||
| 1. Compare the result to the `X-Codacy-Signature` header using a constant-time comparison, and reject the delivery if they don't match. |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This verification flow permits replay of a captured, valid delivery. Include the timestamp and delivery ID in the signed material, or explicitly require consumers to deduplicate X-Codacy-Delivery values and document that the timestamp cannot be trusted for freshness unless it is covered by the signature. Define the exact HMAC input, require constant-time signature comparison, and explain rejection of duplicate delivery IDs and stale requests.
|
Heads-up: the M1 wire contract changed after this was approved (outbound-hooks#15, codacy-events#260):
|
|
amazing |
|
In "Delivery behavior", please also note that Codacy retries a 5xx or a timeout up to 2 more times (200 ms, 400 ms delay) before giving up; only a 4xx drops immediately, without retry. A retry reuses the same |
22e08dd to
3411b56
Compare
|
Addressed both, on #2767 (the wire-contract content, inherited here):
Also split this PR in two: #2767 ships the API-only page this week (org Integrations UI isn't built yet), and this PR now carries just the UI walkthrough on top, to merge once the UI ships. |
|
Update to the retry timing (outbound-hooks#24): a 5xx or timeout is now retried with exponential backoff, about 1 s then 2 s (with jitter), still 3 attempts in total; a 4xx is not retried. Please use these numbers instead of 200 ms / 400 ms. |
Documents the M1 webhooks feature for its first release: adding, listing, and deleting an organization webhook endpoint via the Codacy API (the org Integrations UI page ships in a follow-up), the quality.analysis.completed event, the delivery payload and headers, HMAC-SHA256 signature verification, and delivery behavior (10s timeout, retry on 5xx/timeout, no retry on 4xx, dedupe on X-Codacy-Delivery for retries and commitSha for reanalysis). Registers the page under Organizations > Managing integrations in mkdocs.yml, alongside the Slack and Jira integration pages, and adds a row to the organization permissions table. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3411b56 to
694e068
Compare
8d9b516 to
5d8fb7e
Compare
|
Correction to my previous note: the retry delays are about 1 s then 5 s (exponential factor 5, with jitter), still 3 attempts in total; a 4xx is not retried. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Restacks on #2767 (the API-only release for this week) and adds the org Integrations > Webhooks UI: the Add endpoint flow, the one-time signing-secret card, the endpoint list, and the upgrade prompt shown when the organization isn't entitled. Merge once the UI ships (OD-697, OD-699, OD-701, OD-709). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
694e068 to
0afd385
Compare
…e [OD-702] Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Retargeted to |
Summary
organizations/integrations/webhooks.md, registered under Organizations > Managing integrations next to the Slack and Jira integration pages.createWebhookEndpoint,listWebhookEndpointsanddeleteWebhookEndpoint, with curl examples.quality.analysis.completedevent, payload and headers, HMAC-SHA256 verification, and delivery behavior (10 s timeout,5xxand timeout retried up to 2 more times at about 1 s then 5 s,4xxnot retried, dedupe onX-Codacy-Deliveryfor retries andcommitShafor reanalysis).No IA change: the page sits where both earlier PRs put it, and no file moves, so no redirects are needed.
Sourcing
codacy-spacode (@d063ccddc: OD-696, OD-697, OD-698, OD-701, OD-709). The signing-secret card is from the still-open codacy-spa#3144 (OD-699).Before merging
tempEventWebhooksflag.#delivery-payload. Verification is under#verifying-a-delivery, so the link should change there.Test plan
mkdocs build --strictpasses with no warningsnav:entry present inmkdocs.yml, andsite/organizations/integrations/webhooks/index.htmlis builtvaleon the two changed pages: only the existing em-dash spacing (Microsoft.Dashes) and "backoff" flags remain🤖 Generated with Claude Code