docs(asm): add 403 Forbidden response to all API endpoints#20
Open
dmchaledev wants to merge 1 commit into
Open
docs(asm): add 403 Forbidden response to all API endpoints#20dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every endpoint in
asm/openapi.yamldocumented401 Unauthorizedbut was entirely missing403 Forbidden. These are meaningfully different:For a multi-tenant MSSP product the distinction matters immediately in practice:
403, not401, when it requests Tenant B's assets or vulnerabilities403when it attempts aPATCHorDELETE403on out-of-scope operationsWithout
403in 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
Forbiddenresponse component undercomponents/responseswith an error-envelope example consistent with the existingUnauthorizedshape403: $ref: '#/components/responses/Forbidden'on all 12 endpoints across Assets, Scans, Vulnerabilities, and TagsTest plan
spectral lint asm/openapi.yaml --ruleset spectral:oas --fail-severity warn) — the existing CI workflow covers this automatically on PR🤖 Generated with Claude Code
https://claude.ai/code/session_01MHGZrfqRHJU8Hb9SZXkhU1
Generated by Claude Code