test(#462): add federation M3 integration coverage #685
Reference in New Issue
Block a user
Delete Branch "feat/federation-m3-integration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
FederationAuthGuardand directListControllercalls for the realPOST /api/federation/v1/list/:resourcecontract.Depends on M3-05 and merged M3-06 (#683) in
next.Refs #462
Coverage
unauthorizedenvelope.forbiddenenvelope.max_rows_per_querycap onlist tasks, including_truncated,nextCursor,_source, and exclusion assertions.mission_tasks.notesexclusion on the same authorized mission.scope_violation.Verification
pnpm --filter @mosaicstack/gateway typecheck— PASSpnpm --filter @mosaicstack/gateway lint— PASSpnpm format:check— PASSpnpm --filter @mosaicstack/gateway test -- src/__tests__/integration/federation-m3-list.integration.test.ts— PASS (5 skipped; gated whenFEDERATED_INTEGRATIONunset)FEDERATED_INTEGRATION=1 pnpm --filter @mosaicstack/gateway test -- src/__tests__/integration/federation-m3-list.integration.test.ts— PASS (5 tests, local Postgres + db:push)RETROACTIVE REVIEW-OF-RECORD — APPROVE (#685, merged into next at a3c1ab923c6e4a6190b49e544d175195654d5bd9; PR head
c371e73692). I reviewed the merged FED-M3-10 integration test code and found no concerns requiring a follow-up fix card.Scope/trust-boundary coverage is appropriate for a test-only PR: the gated single-gateway suite exercises malformed/missing Mosaic cert OIDs -> 401 unauthorized envelope, valid cert with revoked grant -> 403 forbidden envelope, max_rows_per_query cap with
_truncated/nextCursor/_source, exclusion of other-user and unauthorized-team task rows, cross-usermission_tasks.notesexclusion on the same authorized mission, and unsupported list resources failing closed with a scope_violation envelope. The fixtures deliberately place excluded rows at newer timestamps, so the cap/exclusion test would catch leakage ahead of valid rows.Implementation review: the suite is correctly gated behind
FEDERATED_INTEGRATION=1, uses real PostgreSQL and the real FederationAuthGuard/FederationScopeService/FederationListQueryService/ListController path, avoids request/response persistence, and cleans up seeded rows by generated IDs. No product/runtime source changes beyond the integration test and scratchpad.Reviewer verification on merge commit
a3c1ab92: ungated scoped integration test run passes as 5 skipped; FEDERATED_INTEGRATION=1 scoped integration test run passes 5/5 against local PostgreSQL; gateway typecheck pass; gateway lint pass; prettier check pass for the integration test and scratchpad. APPROVE.