FED-M3: mTLS handshake + list/get + scope enforcement #462
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Epic: Federation v1 — see
docs/federation/PRD.mdanddocs/federation/MILESTONES.md.Goal
Two federated gateways exchange real data over mTLS with scope intersecting native RBAC. This is the critical trust boundary.
Scope
FederationClient(outbound): picks cert fromfederation_peers, mTLS callFederationServer(inbound): NestJS guard validates client cert, extractsgrantId+subjectUserId, loads grantsubjectUserIdinclude_teams,include_personal)max_rows_per_querycaplist,get,capabilitiessource: "local" | "federated:<host>" | "all"; fan-out + merge for"all"tools/federation-harness/): docker-compose.two-gateways.yml, seed script, assertion helpersDeliverables
apps/gateway/src/federation/client/federation-client.service.tsapps/gateway/src/federation/server/federation-auth.guard.tsapps/gateway/src/federation/server/scope.service.tsapps/gateway/src/federation/server/verbs/{list,get,capabilities}.controller.tsapps/gateway/src/federation/client/query-source.service.ts(fan-out/merge)tools/federation-harness/(compose + seed + test helpers)packages/types—federation.dto.tsAcceptance Tests
list tasksreturns subjectUser's tasks intersected with scopelist taskswithinclude_teams: [T1]excludes T2 tasks the user ownsget credential <id>returns 403 whencredentialsinexcluded_resourcesmax_rows_per_querycaps response; further results paginatedsource: "all"fan-out merges local + federated results, each tagged with_sourcelistround-tripDependencies
Blocked by FED-M2.
Estimated budget
~40K tokens — largest milestone, most complex logic
Risk notes
Critical trust boundary. Code review must focus on scope-enforcement bypass and cert-SAN-spoofing paths. Every 403/401 path needs a test.