Goal — REFACTOR_PLAN.md Step 4
Scaffold the Control Plane API: a Go + Fiber service with /healthz, /readyz, /metrics, structured logging, auth/RBAC/audit middleware placeholders, and a stable layout for handlers / services / repositories.
This is the first time the api repo gets code. It must compile, start, and answer probes — nothing else. Endpoint groups (projects, environments, agents, requests, approvals, audit, sync) come in later issues.
Scope
Acceptance criteria
docker run of the resulting image answers /healthz 200 and /metrics 200
go test ./... green
- The handler tree is split by route group; no business logic in handlers
Hard rules (CLAUDE.md)
- API imports
core/providers + core/sync only at this stage (no provider SDKs in API code)
- Stateless: no in-process state that wouldn't survive a pod restart
- Every privileged endpoint will eventually emit an audit event with a correlation ID — wire the middleware now even if it only logs
References
- BRD §13 FR-14, FR-17, NFR-08, §16.1, §23 (Technical Implementation Decisions)
- REFACTOR_PLAN §6 row 4
Dependencies
- core#1, core#2, core#3 — ✅ merged
Goal — REFACTOR_PLAN.md Step 4
Scaffold the Control Plane API: a Go + Fiber service with
/healthz,/readyz,/metrics, structured logging, auth/RBAC/audit middleware placeholders, and a stable layout for handlers / services / repositories.This is the first time the
apirepo gets code. It must compile, start, and answer probes — nothing else. Endpoint groups (projects, environments, agents, requests, approvals, audit, sync) come in later issues.Scope
go.mod:github.com/secrets-bridge/api, Go 1.24cmd/api/main.gointernal/handlers/(HTTP layer; thin)internal/services/(business logic; testable in isolation)pkg/storage/placeholder (will hold Postgres in core#5)pkg/runtime/placeholder (will hold Redis in core#6)pkg/workflow/placeholder (will hold approval state machine in core#10)GET /healthz(200 always),GET /readyz(200 once DB+Redis stub returns ready),GET /metrics(Prometheus exposition)/api/v1core/.github/workflows/ci.yml(build/test/lint/tidy)README.mddescribing the layoutAcceptance criteria
docker runof the resulting image answers/healthz200 and/metrics200go test ./...greenHard rules (CLAUDE.md)
core/providers+core/synconly at this stage (no provider SDKs in API code)References
Dependencies