Skip to content

feat(asm): add 403 Forbidden response to all endpoints#5

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

feat(asm): add 403 Forbidden response to all endpoints#5
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-bMGfK

Conversation

@dmchaledev
Copy link
Copy Markdown
Contributor

$(cat <<'EOF'

Summary

  • Adds a shared Forbidden response component to components/responses
  • Wires 403 into every path in asm/openapi.yaml (assets, scans, vulnerabilities, tags)

Why this matters

401 Unauthorized and 403 Forbidden are semantically distinct:

Code Meaning When it fires
401 Not authenticated Missing or invalid Bearer token
403 Not authorized Valid token, but insufficient permission

For a multi-tenant MSSP platform this distinction is load-bearing. A token scoped to Tenant A is valid — it should not get a 401 when it tries to read Tenant B's assets. It gets a 403. Without 403 in the spec, SDK generators produce client code with no branch for this case, integrators assume a 401/404 binary, and MSSP admins spend time debugging "why is my valid key failing?"

Test plan

  • CI Spectral lint passes on the updated spec
  • Verify 403 example body (code: forbidden) is consistent with the existing 401 and 404 examples in style
  • Confirm no existing SDK or generated client breaks (additive change — new response codes never break existing clients)

https://claude.ai/code/session_01VojGqysVpUpTbNquLSsPF3
EOF
)


Generated by Claude Code

401 and 403 are distinct: 401 means unauthenticated, 403 means
authenticated but lacking permission. In a multi-tenant MSSP
environment, a valid token scoped to one tenant will correctly
receive 403 when accessing another tenant's assets, scans, or
vulnerabilities — not 401. Documents this contract for integrators
and enables SDK generators to produce correct error-handling code.

https://claude.ai/code/session_01VojGqysVpUpTbNquLSsPF3
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