fix: reject plain HTTP repository sources

This commit is contained in:
2026-09-13 00:29:16 +09:00
parent 5564425488
commit 7675f81999
9 changed files with 222 additions and 60 deletions
@@ -237,7 +237,6 @@ export type RepositorySourceKind =
| "local_path"
| "file"
| "ssh"
| "http"
| "https"
| "invalid";
@@ -56,7 +56,6 @@ const SOURCE_KINDS = new Set<RepositorySourceKind>([
"local_path",
"file",
"ssh",
"http",
"https",
"invalid",
]);
@@ -47,6 +47,19 @@ Deno.test("generated repository wrapper validates current Backend JSON", () => {
}
});
Deno.test("plain HTTP repository source kind fails closed at the JSON boundary", () => {
const stale = structuredClone(repositoryList) as Record<string, unknown>;
const items = stale.items as Array<Record<string, unknown>>;
items[0].source = {
kind: "http",
uri: "http://git.example.test/team/project.git",
};
assertThrows(
() => parseRepositoryListResponse(stale),
".source.kind is invalid",
);
});
Deno.test("stale repository aliases fail closed at the JSON boundary", () => {
const stale = structuredClone(repositoryList) as Record<string, unknown>;
const items = stale.items as Array<Record<string, unknown>>;