Skip to content

feat(cf-accounts): implement control plane accounts REST API service#18

Merged
jtomasevic merged 1 commit into
mainfrom
CF-0.14-control-plain
May 3, 2026
Merged

feat(cf-accounts): implement control plane accounts REST API service#18
jtomasevic merged 1 commit into
mainfrom
CF-0.14-control-plain

Conversation

@jtomasevic
Copy link
Copy Markdown
Owner

Adds cf-accounts — the CloudForge control plane service that manages tenant account lifecycle and API key issuance, following docs/general/webappsec.md.

Architecture highlights:

  • 3-layer design: cmd/cf-accounts → services/accounts → services/accounts/service
  • OpenAPI-first: api/accounts/v1/openapi.yaml drives oapi-codegen output
  • Provisioner embedded as Go library (same process, no HTTP round-trip)
  • wire.go single composition root keeps main.go < 60 lines
  • Hand-rolled store interfaces enable unit testing without a live DB

Endpoints:
POST /accounts → 202 Accepted (async VPC provisioning)
GET /accounts/{slug} → account status + CIDR info
DELETE /accounts/{slug} → 202 Accepted (async teardown)
POST /accounts/{slug}/keys → 201 Created (raw key returned once)
DELETE /accounts/{slug}/keys/{key_id} → 204 No Content

Test coverage (≥90% requirement):
services/accounts 97.4%
services/accounts/service 93.3%
cmd/cf-accounts/config.go 100.0%

Infrastructure: deploy/kustomize/base/cf-accounts.yaml Kubernetes Deployment + Service + Secret
deploy/docker/Dockerfile.accounts Distroless image
Makefile: deploy-accounts, accounts-*, accounts-coverage targets
dev-up: now deploys CF-Accounts as part of the platform boot sequence

@jtomasevic jtomasevic force-pushed the CF-0.14-control-plain branch from 0b3b257 to 3532f11 Compare May 2, 2026 02:24
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 95.60811% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/accounts/tenant.go 0.00% 14 Missing ⚠️
internal/accounts/user.go 92.75% 5 Missing ⚠️
services/accounts/service/service.go 95.87% 2 Missing and 2 partials ⚠️
cmd/cf-accounts/wire.go 95.00% 1 Missing and 1 partial ⚠️
cmd/cf-provisioner/wire.go 97.05% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jtomasevic jtomasevic force-pushed the CF-0.14-control-plain branch 7 times, most recently from c9a95eb to 751d74e Compare May 3, 2026 00:03
Adds cf-accounts — the CloudForge control plane service that manages
tenant account lifecycle and API key issuance, following docs/general/webappsec.md.

Architecture highlights:
- 3-layer design: cmd/cf-accounts → services/accounts → services/accounts/service
- OpenAPI-first: api/accounts/v1/openapi.yaml drives oapi-codegen output
- Provisioner embedded as Go library (same process, no HTTP round-trip)
- wire.go single composition root keeps main.go < 60 lines
- Hand-rolled store interfaces enable unit testing without a live DB

Endpoints:
  POST   /accounts                          → 202 Accepted (async VPC provisioning)
  GET    /accounts/{slug}                   → account status + CIDR info
  DELETE /accounts/{slug}                   → 202 Accepted (async teardown)
  POST   /accounts/{slug}/keys              → 201 Created (raw key returned once)
  DELETE /accounts/{slug}/keys/{key_id}     → 204 No Content

Test coverage (≥90% requirement):
  services/accounts          97.4%
  services/accounts/service  93.3%
  cmd/cf-accounts/config.go  100.0%

Infrastructure: deploy/kustomize/base/cf-accounts.yaml  Kubernetes Deployment + Service + Secret
  deploy/docker/Dockerfile.accounts       Distroless image
  Makefile: deploy-accounts, accounts-*, accounts-coverage targets
  dev-up: now deploys CF-Accounts as part of the platform boot sequence
Co-authored-by: Cursor <cursoragent@cursor.com>
@jtomasevic jtomasevic force-pushed the CF-0.14-control-plain branch from 751d74e to f88f2c3 Compare May 3, 2026 00:32
@jtomasevic jtomasevic merged commit 0128bd0 into main May 3, 2026
15 checks passed
@jtomasevic jtomasevic deleted the CF-0.14-control-plain branch May 3, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant