feat(cf-accounts): implement control plane accounts REST API service#18
Merged
Conversation
0b3b257 to
3532f11
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
c9a95eb to
751d74e
Compare
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>
751d74e to
f88f2c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds cf-accounts — the CloudForge control plane service that manages tenant account lifecycle and API key issuance, following docs/general/webappsec.md.
Architecture highlights:
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