Enable X-Service: workflow routing to Temporal via ServiceAdapter.
Users can now specify namespace/domain in request payload for multi-tenant
workflow access.
Changes:
- Implement WorkflowAdapter in serviceadapter/workflow_adapter.go
* Defines 10 workflow resources: start, describe, list, history,
terminate, cancel, signal, query, reset, update
* Each resource validates namespace parameter in payload
* Forwards requests to Temporal gRPC handler
- Add GetWorkflowSpec() to define ServiceAdapter spec with:
* Upstream: grpc://temporal:7233
* Auth requirements per operation (execute, read, signal, query)
* Request/response schemas for validation
- Wire WorkflowAdapter into main.go:
* Register workflow adapter in serviceadapter registry
* Initialize with temporal handler for gRPC forwarding
- Remove old empty WorkflowAdapter stub from adapters.go
Usage:
curl -X POST https://api.riotpiao.com/ \
-H 'X-Service: workflow' \
-H 'X-Resource: start' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"namespace": "default",
"workflow_id": "my-workflow",
"workflow_type": "MyWorkflow",
"task_queue": "default"
}'
Namespace is required in all workflow operations and must be specified
by the client in the request payload. This enables multi-tenant support
where different teams access their own Temporal namespaces.
- Add internal/tracing package with OTel tracer initialization
- HTTP middleware for server-side tracing (request/response attributes)
- Transport wrapper for client-side upstream call tracing
- Update proxy to use tracing transport
- Add OTEL_* env vars to k8s deployment
Traces flow: api-gateway -> otel-collector -> tempo -> grafana
Adapters defined in config.yaml alongside routes and models.
Parsed by existing config loader, populated into registry at startup.
Removed: client-go deps, REST loader, informer, nginx proxy,
CiliumNetworkPolicy, apis/gateway/v1/ (duplicate types).
Kept: merged CI pipeline, imagePullPolicy Always, CA certs in Dockerfile.
Creates:
- cmd/worker/main.go: Worker that registers workflows and activities
- cmd/test-workflow/main.go: Test client to trigger workflows
Adds go.temporal.io/sdk dependency to go.mod.
- 2.3: unknown model errors (400 + RFC 9457 problem+json with valid_models)
- 2.5: GET /v1/models endpoint (derived from config, not hardcoded)
- 2.6: POST /v1/embeddings passthrough (body-based dispatch, no rewrite)
- 2.7: POST /v1/rerank with path rewrite (/v1/rerank → /rerank)
- wire proxy.Handler in main.go (was using dummy handler)
- 140+ tests passing, race detector clean
- all requests: client → nginx → gateway → upstreams
- ready for config deployment to go live
Baseline for the Kong replacement on api.riotpiao.com. Brings the working
tree under version control for the first time: gateway source, the task
board that drives the agent runs, test fixtures, and K8s manifests.
Anchor the gateway ignore rule to the repo root. Unanchored, "gateway"
also matched the cmd/gateway/ source directory, so the program entrypoint
was excluded from every commit.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>