Skip to content

fix: return generic error for workspace resolution failures (#17)#19

Open
mgoldsborough wants to merge 1 commit intomainfrom
fix/issue-17-generic-workspace-errors
Open

fix: return generic error for workspace resolution failures (#17)#19
mgoldsborough wants to merge 1 commit intomainfrom
fix/issue-17-generic-workspace-errors

Conversation

@mgoldsborough
Copy link
Copy Markdown
Contributor

Summary

  • Workspace resolution returned distinct responses for non-existent workspaces (400, "Workspace "ws_x" not found") vs unauthorized access (403, "Access denied: not a member of ws_x"). The combination of status codes and ID-bearing messages let any authenticated caller probe for workspace existence and membership.
  • Collapsed both cases to a single 403 with the generic message "Access denied to workspace." and no workspace ID echo. Input validation paths (invalid format, multiple-workspace ambiguity) are left alone — they do not signal existence of other tenants' workspaces.

Test plan

  • `bun test test/unit/api/ test/integration/workspaces-identity.test.ts` — 104 pass
  • `bun run lint` — no new warnings
  • `bun run check` — clean typecheck
  • Updated unit tests assert generic message and 403 status for both paths, and explicitly assert the workspace ID is not echoed

Closes #17

Workspace resolution previously returned distinct responses for
non-existent workspaces (400, "Workspace \"ws_x\" not found") and
unauthorized access (403, "Access denied: not a member of ws_x").
The combination of distinct status codes and ID-bearing messages
let any authenticated caller probe for workspace existence and
membership.

Collapse both to a single generic 403 "Access denied to workspace."
with no workspace ID echo. Input validation paths (invalid format,
multiple-workspace ambiguity) are untouched — they do not signal
existence of other tenants' workspaces.
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.

Use generic error messages for workspace resolution failures

1 participant