Skip to content

docs(asm): add OpenAPI 3.1 webhooks section for scan status events#21

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-6y1ddy
Open

docs(asm): add OpenAPI 3.1 webhooks section for scan status events#21
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-6y1ddy

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

  • POST /scans tells callers to "subscribe to webhooks to track completion" but the spec had zero webhook payload documentation — a dead end for any developer building event-driven automation.
  • This PR adds a first-class webhooks: section (natively supported in OpenAPI 3.1) covering the three terminal scan events: scan.completed, scan.failed, and scan.cancelled.
  • Each event delivers the full ScanDetail schema, so consumers get asset counts and vulnerability-by-severity breakdowns without a follow-up API call.
  • Includes HMAC-SHA256 signature verification guidance (with a Python snippet) and retry/acknowledgement semantics.

What changed

asm/openapi.yaml — added a top-level webhooks: block (~100 lines):

Item Detail
Event types scan.completed, scan.failed, scan.cancelled
Payload schema Reuses ScanDetail — no new schemas needed
Examples Two full request body examples (completed + failed)
Security guidance HMAC-SHA256 X-HailBytes-Signature-256 verification snippet
Retry semantics 5 retries with exponential back-off; 410 removes the endpoint

Test plan

  • Confirm spectral lint asm/openapi.yaml --ruleset spectral:oas passes (CI validates this)
  • Verify the webhook section renders correctly in the Redoc preview on the GitHub Pages site after merge
  • Check that the ScanDetail $ref in the webhook request body resolves correctly in any OpenAPI tooling (Postman, Swagger UI, etc.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01ECLzW74k3Uct8QrnxnwfWH


Generated by Claude Code

The POST /scans description mentions subscribing to webhooks to track
async scan completion, but no webhook payload was documented anywhere.
This adds a first-class `webhooks:` section (native to OpenAPI 3.1)
covering scan.completed, scan.failed, and scan.cancelled events,
including HMAC-SHA256 signature verification guidance and full
request body examples.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECLzW74k3Uct8QrnxnwfWH
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