AgoraIO-Extensions / AgoraIO-Extensions/agent-infra
feat(connection): constrain GitHub Pilot provider and repository policy
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Merge medio
- 8h 51m
- PR unite (30g)
- 99
Descrizione
## Problem
当前候选 runtime 默认发布完整 GitHub Catalog 并可能请求高风险 scope;Pilot 只允许三个 Action、专用账号和一个受控 private 仓库。
## Scope
- 固定并校验 OpenConnector Kernel provenance,只通过进程内 Adapter 复用 GitHub metadata/schema/OAuth helper/executor closure。
- ProviderRelease 仅包含 `github.get_current_user`、`github.list_my_repositories` 和 `github.create_pull_request` 三个 immutable ActionVersion。
- OAuth 请求严格为 `read:user + repo`,不请求 `user:email`、`workflow`、`delete_repo`;保存并验证实际 granted scopes。
- 使用 `github.com + numeric user id` 作为稳定外部账号标识,login/name 只展示。
- 服务端 repository allowlist 只允许一个配置的 private Pilot 仓库;所有 Action 在访问 Provider 前执行目标仓库检查。
- 不实现 GitHub App、其他 GitHub Action、其他 Provider、Connection Grant 或可靠性 worker。
## Acceptance criteria
- [ ] **AC-1:** 构建和启动只发布三个 ActionVersion,默认全 Catalog 和其他 GitHub Action 不可发现也不可执行。
- [ ] **AC-2:** OAuth URL 只请求 `read:user repo`,callback 保存实际 granted scope,scope 缺失或缩减时 fail closed。
- [ ] **AC-3:** 数值 GitHub user ID 稳定绑定账号,login 改名不创建新 Connection,不同 ID 不能覆盖原账号。
- [ ] **AC-4:** repository allowlist 在 Adapter/Connection 服务端强制执行,任何其他 owner/repo 在 Provider 网络调用前被拒绝且不枚举权限。
- [ ] **AC-5:** provenance、license/notice、digest、schema、scope、repository denial 和三项 executor contract tests 全部通过。
## Validation
- 运行 Kernel provenance、Adapter unit/contract、scope 和 repository policy tests。
- 使用受控 GitHub 测试账号做 current-user、repository listing 和 create-PR 的 focused manual smoke;不将其视为完整 Pilot。
- 运行完整仓库验证序列。
## Blocked by
- #393
- #398
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.