fix(api): scope workspace search to visible projects and pages#367
fix(api): scope workspace search to visible projects and pages#367cavidelizade wants to merge 1 commit into
Conversation
Search authorized only workspace membership and filtered the SQL by workspace_id, so a plain member (or guest) got back issues, cycles, modules, views and names from secret projects they weren't on, plus the titles of other users' private pages. Add a project-visibility predicate (public, or the caller is a project member or a workspace admin/owner) to every project-joined query, mirroring ProjectService.GetByID, and restrict page hits to public pages or ones the caller owns. Covered by a test that a non-member can't find a secret project's issue or the project itself while a member can. Closes Devlaner#324 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Workspace search authorized only workspace membership and filtered the SQL by
workspace_id, so a plain member (or guest) got back issues, cycles, modules, views and names from secret projects they weren't on, plus the titles of other users' private pages.Linked issues
Closes #324
Type of change
fix:)Surface
apps/api/)What changed
projectVisibleClause: a project is visible when it's public, the caller is a member of it, or the caller is a workspace admin/owner. This mirrors the gate inProjectService.GetByID. Applied it to every project-joined search query (issues, epics, cycles, modules, views, projects).userIDfrom the service into the storeSearch.Test plan
go build,go vet,go test ./...green, includingTestSearchRespectsProjectVisibility(a non-member can't find a secret project's issue or the project itself; a member can)Note
This is a separate path from the sub-resource fix in #319, which is why it needed its own change. The private-page-title leak isn't about secret projects at all and is fixed by the page access/owner filter.
AI assistance
Claude Code (Opus 4.8), commits carry aCo-Authored-By:trailer