sp4-v2-1770499323/.sdlc/features/mesh-interop/spec.md
rdev-worker 34f37a44b8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature mesh-interop --requirements 'Chat Service must cal...
2026-02-07 21:49:45 +00:00

24 lines
1.2 KiB
Markdown

# Feature Spec: Service Mesh Interop
## Summary
Enable inter-service communication: Chat Service validates tokens via auth-svc, and pushes async tasks to the PostgreSQL job queue for Worker to process.
## Requirements
1. **Auth-svc /validate endpoint**: Auth Service exposes `POST /api/auth-svc/validate` that accepts a Bearer token and returns the validated user info.
2. **Chat-svc token validation**: Chat Service calls `http://auth-svc/api/auth-svc/validate` via `pkg/svc` client to check tokens on protected endpoints.
3. **Chat-svc queue producer**: Chat Service pushes jobs to the PostgreSQL queue (via `pkg/queue`) for async processing by Worker.
4. **Worker job processing**: Worker registers a handler for `chat_task` job type and processes tasks from the queue.
## Non-Goals
- No new database schemas beyond existing jobs table
- No Redis (using existing PostgreSQL queue)
- No new frontend changes
## Acceptance Criteria
- [ ] Auth-svc has a `/validate` endpoint that validates JWT tokens
- [ ] Chat-svc calls auth-svc to validate tokens on protected routes
- [ ] Chat-svc can enqueue jobs to the queue
- [ ] Worker processes `chat_task` jobs
- [ ] All components have tests
- [ ] All tests pass