Repository navigation
[v2] 项目镜像与固定 snapshot 的同步 HTTP 接口 - #231
Merged
EricWvi merged 1 commit intoOct 30, 2026
Merged
Conversation
ElephantGit
marked this pull request as ready for review
October 30, 2026 09:35
This was referenced Oct 30, 2026
Collaborator
独立只读审查(成员,非本运行 reviewer)审过 commit 已核对
需要明确的一点(非阻塞,但请给结论):HTTPS 目标没有 loopback / 私网限制
也就是说,README 里「loopback 只在测试启用」只对 http 成立;生产中任何登录成员都能让后端去 clone 任意 HTTPS 主机(包括 loopback 和内网地址)。这是 v2-server 目前唯一由用户输入触发的服务端外连,属于 SSRF 面。两种收口都可以:明确写出信任模型(v2-server 只跑在本机/可信网络,成员可信),或者对 https 也拒绝 loopback/私网(解析后校验 IP,或用 host allowlist)。请 owner 或作者定一个并写进 README。 其余(都是小点,可以后置)
|
Merged
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.
项目需要先有可复用的固定仓库快照,执行侧才能按项目创建独立对话目录。新增 projectrepos 服务:校验当前成员和匿名 HTTPS 仓库/分支,完成一次 mirror clone、创建固定 snapshot ref,再写入已合并的 PostgreSQL 项目记录;失败不创建项目,之后不 fetch 或向上游写回。
新增同步候选接口 GET/POST /api/v2/tenants/{tid}/projects 和 GET /api/v2/tenants/{tid}/projects/{pid},支持分页与当前成员归属检查,创建者取真实登录身份,响应不暴露镜像路径或凭据。候选 OpenAPI 与真实 HTTP 测试一并交付,正式 v1 契约不变。内部 SeedDemo 可准备真实本地 Git 演示项目,不能由浏览器指定本地源。
本 PR 共 8 个交付文件,基于 main aae23e8;只新增 server.Options.Projects 和三条项目路由,不改 Execution/Catalog 注入。main 尚未装配项目服务,未配置时返回 503 projects_unavailable;正常启动 seed、Node、公共 Service 与最终入口另行交付。
验证:Go 1.27.1、PostgreSQL 17.11 下 gofmt、go vet ./...、TEST_DATABASE_URL=... go test -race -count=1 ./...、go build 和 git diff --check 全部通过。真实 Git/HTTP/PostgreSQL 用例覆盖缺失分支、clone 失败、固定 snapshot、隔离继承 Git 配置、归属验证先于远端访问、源仓库移除后的服务重建读取,以及并发/重复 demo seed;HTTP 响应按候选 OpenAPI 校验。
v2,不涉及 specs。
Refs ora-space/circus#774