feat(managementapi): probe-dispatched listing branch part 2/4 (S09 Enforcement plan: 19/20)

Part 2 of 4 of the S09 enforcement plan — Step 19: Permission-filtered repository listing.

The step is split into 4 stacked MRs to keep each within the review size limit (≈800 ideal). Each part targets the previous one; the stack sits on step 18 part 4 (!2146 (merged)). Review and merge bottom-up.

Stacked MRs (review/merge bottom-up)

This part (~1,070 reviewable LoC)

The two-branch dispatch, wired end to end at the handler:

  • managementapi.DecisionEvaluator gains Probe; the scopeListingFilter binding arm keeps only the anonymous pre-gate (a denied namespace Check on this route means "run the filter", never "refuse").
  • Deps gains the three listing seams (RepositoryCandidates, ListingRelationships, ListingBatchChecker); handleList dispatches on the namespace-scoped Probe verdict — allowed lists from the datastore unchanged, denied runs part 1's filter, a dependency failure answers 503 with Retry-After, and a canceled request writes nothing.
  • Ancestor ids for GLAZ (which trusts ancestor_ids unverified) derive once per request from the resolved target namespace, never from the request — pinned by the ancestor-provenance and Probe-argument tests.

Tests: the dispatch-level HTTP suite (namespace-allowed parity, no-access empty 200, failure matrix, abandon, ancestor provenance under hostile query parameters, organization-ancestor propagation, missing-identity fail-closed), plus the namespaceAncestorIDs/repositoryAncestorIDs distinction pin and the strengthened listing-binding test (Evaluate never runs at the routing layer; Probe runs exactly once in the handler).

This part carries interim cmd/artifact-registry wiring so every part compiles and boots (Probe stubs on the existing evaluator doubles, fail-closed placeholder seams at both Deps construction sites); part 4 replaces it with the final wiring.

Size

Over the 500 LoC guideline because the DecisionEvaluator interface widening is compile-atomic: every fake implementing the interface (seven test files) must gain Probe in the same commit as the interface change, and the dispatch tests are only meaningful against the wired handler.

References

No e2e scenario is added or affected: no catalog covers the management API, and the listing filter's behavior is pinned by this step's handler tests (plan Testing Strategy).

Related to #861 (closed)

Edited by David Fernandez

Merge request reports

Loading
Loading