Skip to content

docs(asm): add 403 Forbidden response to all API endpoints#20

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

docs(asm): add 403 Forbidden response to all API endpoints#20
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-vso6ac

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

Every endpoint in asm/openapi.yaml documented 401 Unauthorized but was entirely missing 403 Forbidden. These are meaningfully different:

  • 401 — credentials absent or invalid (unauthenticated)
  • 403 — credentials valid, but the caller lacks permission for this resource (authenticated but unauthorized)

For a multi-tenant MSSP product the distinction matters immediately in practice:

  • An API key scoped to Tenant A receives 403, not 401, when it requests Tenant B's assets or vulnerabilities
  • A read-only key receives 403 when it attempts a PATCH or DELETE
  • MSSP operators with delegated-but-limited scope receive 403 on out-of-scope operations

Without 403 in the spec, SDK generators omit the case entirely and integrators write no error-handling branch for it — leading to silent failures or misrouted exceptions in production.

Changes

  • Added a shared Forbidden response component under components/responses with an error-envelope example consistent with the existing Unauthorized shape
  • Referenced 403: $ref: '#/components/responses/Forbidden' on all 12 endpoints across Assets, Scans, Vulnerabilities, and Tags

Test plan

  • Spectral lint passes (spectral lint asm/openapi.yaml --ruleset spectral:oas --fail-severity warn) — the existing CI workflow covers this automatically on PR
  • Rendered Redoc docs show the 403 response tab on every operation

🤖 Generated with Claude Code

https://claude.ai/code/session_01MHGZrfqRHJU8Hb9SZXkhU1


Generated by Claude Code

Every endpoint had 401 Unauthorized but was missing 403 Forbidden.
For an MSSP multi-tenant product, a valid API key scoped to one
tenant will receive 403 when accessing another tenant's resources or
performing an action beyond its permission level — a distinct and
important error that integrating developers need to handle.

Adds a shared Forbidden response component and references it from
all 12 endpoints across Assets, Scans, Vulnerabilities, and Tags.

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