Skip to content

Add a service-level RBAC test for ProjectService.List #3419

Closed

Description

@migmartri

Follow-up from #3418, which added ProjectService.List.

That PR covers the RBAC filtering at the business layer, in app/controlplane/pkg/biz/project_list_integration_test.go. The table asserts the semantics that matter:

  • a nil VisibleProjects means no restriction, so every project in the organization is returned
  • an empty non-nil VisibleProjects means nothing is visible, not everything — the distinction that would leak project names if it were ever inverted
  • a subset restricts the result to that subset
  • another organization's projects are never returned
  • the name filter and the visible-project filter combine

What is not covered is the service handler itself. ProjectService.List resolves the current organization and forwards s.visibleProjects(ctx) into those options, and that hand-off has no test. It is a pass-through today, and visibleProjects is the same helper every other list handler already relies on, which is why it was left out rather than blocking the PR.

Worth adding a service-level integration test that exercises the real path end to end:

  • a project viewer sees only the projects they are a member of
  • an org member with no RBAC restriction sees all of them
  • a caller from another organization sees none
  • pagination and the name filter behave through the RPC

The platform repo has an equivalent in backend/internal/service/projects_authz_integration_test.go that can be used as a shape reference.

This becomes more than hygiene the moment the handler grows any decision of its own beyond forwarding the visible set.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions