Remove partner scope from client-controlled list filters
Changing partnerId in the purchase-order query reveals another partner's orders. The controller authenticates the session but trusts the query filter to choose the tenant.
- Focused work estimate
- 2h 30m + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Tenant isolation · Repository boundaries · Pagination security
Estimated field mix
- Security60%
- Backend40%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional manufacturing company shares purchase-order documents with partner organizations. Buyers, partner administrators, and read-only agents use the same API. Recent support reports suggest list filters and background downloads disagree about who may see an order.
Setup prerequisites
- HTTP APIs
- Session authentication
- Tenant-scoped data access
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Derive authorized partner scope from the server-side actor context.
- Apply that scope within the order repository query.
- Return scoped counts and pagination cursors that cannot widen access.
Implementation constraints
- Test the repository directly as well as the route; controller-only filtering is insufficient.
Verification to include
- List two pages of the authorized partner's orders with correct counts.
- Replace partnerId and replay a foreign cursor; assert no foreign records or totals.
Deliverables
- Tenant-scoped list boundary and denial regressions
Rollout and recovery
Switch the synthetic partner list first; disable the route if scoped count comparisons fail.
Value of the work
For the engineer: Practice authorization as a service-level invariant, including revocation timing, concurrent membership changes, and asynchronous data delivery.
For the team: Inspect a concrete record of cross-organization denial, least-privilege decisions, and access-recovery behavior using fictional partner records.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.