feat(api): REST API for repository onboarding and management

Open
#1,021 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@alvarohare is already working on this.

Since Nov 10, 2026.

  • #1032 by @ClintEastman02 — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, typescript
Domain
api, backend

Research direction

Start with docs/design/REPO_ONBOARDING.md and the existing repo policy route, GET /repos/{repo_id}/policies, to trace the API handler, authorization, and persistence patterns. Then read cdk/src/blueprints/definitions.ts, cdk/src/handlers/shared/types.ts, and cli/src/types.ts for the current config and validation boundaries. Done means implementing and documenting authenticated repo CRUD, shared validation, secret handling, and CLI integration; this issue leaves several design choices open, so coordinate them with maintainers first.

Written by the indexing model from the issue text.

Description

approved
Component

API or orchestration

Describe the feature

Add a REST API for onboarding and managing repositories at runtime, so operators can register, update, and offboard repos without editing CDK and redeploying, and without holding AWS credentials with direct DynamoDB access.

Today repository management has three disjoint paths:

  • CDK Blueprint construct (canonical) — add an entry to cdk/src/blueprints/definitions.ts and redeploy; the custom resource writes a RepoConfig row to RepoTable.
  • bgagent repo list | show | onboard | offboard (from #378) — writes RepoTable directly using the operator's AWS credentials, bypassing the API, its auth, and its validation.
  • REST — the only repo-scoped route is GET /repos/{repo_id}/policies. There is no repo CRUD.

docs/design/REPO_ONBOARDING.md states this directly: "There is no runtime API for repo CRUD."

Use case
  • Platform teams embedding ABCA into an internal developer portal or software factory want to onboard repos programmatically (e.g. when a new service repo is created) via an authenticated HTTP API, not a CDK change + deploy or a CLI that needs IAM write access to DynamoDB.
  • Workshop / multi-team deployments need to add repos in minutes without a ~10 minute cdk deploy.
  • The operator web console cannot offer repo management without a backend API.
  • Distributing IAM credentials with RepoTable write access to every repo admin is a wider blast radius than a scoped, audited API.
Proposed solution

Endpoints (Cognito-authenticated, admin-gated):

Method Path Purpose
GET /v1/repos List onboarded repos (status, model, compute type, updated_at); paginated
POST /v1/repos Onboard / re-activate a repo (owner/repo, model, token secret ref, optional overrides)
GET /v1/repos/{repo_id} Full RepoConfig (secret ARNs redacted)
PATCH /v1/repos/{repo_id} Update mutable fields
DELETE /v1/repos/{repo_id} Soft delete (status=removed + TTL, same as Blueprint removal)

Design points:

  1. Same schema and validation as Blueprint. Reuse the construct's validation (repo pattern, model allowlist, budget bounds from contracts/constants.json, egress domain pattern) in a shared module so API- and CDK-onboarded repos are indistinguishable to the orchestrator. Reject models that are not granted to the runtime (see #805) and verify the token can reach the repo at onboard time rather than failing at turn 0.
  2. Authorization. Require membership in an admin Cognito group (e.g. abca-repo-admins) for writes, and/or a scoped platform API key (repos:manage) via the existing unified Cognito-or-API-key RequestAuthorizer used for webhook management. Reads could be open to authenticated users or gated similarly.
  3. CDK vs API precedence. Record the provenance of each row (source: cdk | api) and document precedence — e.g. CDK-managed rows are read-only via the API (409 with guidance), or last-writer-wins with a warning. CDK users who want repo config in Git keep the Blueprint path.
  4. Secrets. Accept a Secrets Manager ARN reference for per-repo tokens; never accept or return raw token values. Orchestrator IAM must be able to read referenced secrets (today this requires additionalSecretArns at deploy time — the API path needs a scoped pattern or tag-based grant).
  5. CLI. Move bgagent repo onboard | offboard | list | show onto the API so they no longer need AWS credentials (keep the direct path behind a flag for break-glass if desired).
  6. Types/docs. Update cdk/src/handlers/shared/types.ts + cli/src/types.ts, docs/design/API_CONTRACT.md, and REPO_ONBOARDING.md.
Other information
  • This is section 2 ("Runtime repository onboarding API") of RFC #377, split out so it can ship independently of the larger infra/runtime deploy split. See the split request on #377.

  • Related: #378 (CLI operator commands, closed), #476 (principal-to-repo authorization — natural follow-on once repos are API-managed), #805 (repo onboard --model validation), #369 (mapping repos with no Blueprint), #443 (re-onboarding on default-branch drift), #453 (OpenAPI publication), #1022 (user and team management API).

  • I may be able to implement this feature

  • This might be a breaking change

Dominant language
TypeScript
Stars
185
Forks
54
Avg merge
3d 3h
Merged PRs (30d)
27

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws-samples/sample-autonomous-cloud-coding-agents

All issues in aws-samples/sample-autonomous-cloud-coding-agents

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.