Jason Woltje
1159ca42a7
feat(#88): implement QUERY message type for federation
Implement complete QUERY message protocol for federated queries between
Mosaic Stack instances, building on existing connection infrastructure.
Database Changes:
- Add FederationMessageType enum (QUERY, COMMAND, EVENT)
- Add FederationMessageStatus enum (PENDING, DELIVERED, FAILED, TIMEOUT)
- Add FederationMessage model for tracking all federation messages
- Add workspace and connection relations
Types & DTOs:
- QueryMessage: Signed query request payload
- QueryResponse: Signed query response payload
- QueryMessageDetails: API response type
- SendQueryDto: Client request DTO
- IncomingQueryDto: Validated incoming query DTO
QueryService:
- sendQuery: Send signed query to remote instance via ACTIVE connection
- handleIncomingQuery: Process and validate incoming queries
- processQueryResponse: Handle and verify query responses
- getQueryMessages: List workspace queries with optional status filter
- getQueryMessage: Get single query message details
- Message deduplication via unique messageId
- Signature verification using SignatureService
- Timestamp validation (5-minute window)
QueryController:
- POST /api/v1/federation/query: Send query (authenticated)
- POST /api/v1/federation/incoming/query: Receive query (public, signature-verified)
- GET /api/v1/federation/queries: List queries (authenticated)
- GET /api/v1/federation/queries/🆔 Get query details (authenticated)
Security:
- All messages signed with instance private key
- All responses verified with remote public key
- Timestamp validation prevents replay attacks
- Connection status validation (must be ACTIVE)
- Workspace isolation enforced via RLS
Testing:
- 15 QueryService tests (100% coverage)
- 9 QueryController tests (100% coverage)
- All tests passing with proper mocking
- TypeScript strict mode compliance
Refs #88
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 13:12:12 -06:00
..
2026-01-28 13:31:33 -06:00
2026-01-28 16:06:34 -06:00
2026-01-28 16:24:25 -06:00
2026-01-28 17:26:34 -06:00
2026-01-28 17:26:34 -06:00
2026-01-28 18:43:12 -06:00
2026-01-29 12:29:21 -06:00
2026-01-29 12:29:21 -06:00
2026-01-29 12:29:21 -06:00
2026-01-29 12:29:21 -06:00
2026-01-29 12:29:21 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:38:16 -06:00
2026-02-03 10:58:50 -06:00
2026-02-03 11:41:07 -06:00
2026-02-03 12:34:24 -06:00
2026-02-03 12:55:37 -06:00
2026-02-03 13:12:12 -06:00
2026-01-31 11:38:38 -06:00
2026-01-31 12:10:43 -06:00
2026-01-31 12:22:14 -06:00
2026-01-31 11:57:40 -06:00
2026-02-01 17:56:04 -06:00
2026-02-01 20:52:43 -06:00
2026-02-01 20:22:07 -06:00
2026-02-01 20:52:43 -06:00
2026-02-01 20:52:43 -06:00
2026-02-01 20:52:43 -06:00
2026-02-01 20:56:45 -06:00
2026-02-01 21:09:03 -06:00
2026-02-01 21:01:25 -06:00
2026-02-01 21:09:03 -06:00
2026-02-01 21:16:23 -06:00
2026-02-01 21:16:23 -06:00
2026-02-01 21:16:23 -06:00
2026-02-01 21:26:40 -06:00
2026-02-01 21:32:53 -06:00
2026-02-01 21:42:44 -06:00
2026-02-01 21:22:41 -06:00
2026-02-02 08:18:55 -06:00
2026-02-01 21:44:04 -06:00
2026-02-01 21:54:34 -06:00
2026-02-01 20:54:25 -06:00
2026-02-01 21:09:03 -06:00
2026-02-01 20:54:57 -06:00
2026-02-02 11:41:11 -06:00
2026-02-02 11:41:38 -06:00
2026-02-02 11:52:41 -06:00
2026-02-02 11:47:11 -06:00
2026-02-02 12:51:17 -06:00
2026-02-02 12:41:12 -06:00
2026-02-02 12:24:29 -06:00
2026-02-02 12:30:19 -06:00
2026-02-02 12:03:36 -06:00
2026-02-02 12:13:17 -06:00
2026-02-02 12:51:17 -06:00
2026-02-02 12:55:17 -06:00
2026-02-02 13:04:34 -06:00
2026-02-02 13:07:16 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 14:33:31 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 15:27:00 -06:00
2026-02-02 14:33:31 -06:00
2026-01-29 12:29:21 -06:00