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

Đang mở
#1,021 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@alvarohare đang làm issue này rồi.

Từ ngày 10/11/2026.

  • #1032 của @ClintEastman02 — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
aws, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
185
Fork
54
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
27

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws-samples/sample-autonomous-cloud-coding-agents

Tất cả issue của aws-samples/sample-autonomous-cloud-coding-agents

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.