feat: recover interrupted installation preparation safely

This commit is contained in:
Codex
2026-10-06 19:02:01 +02:00
parent 5c05778614
commit af6cf88b5a
32 changed files with 497 additions and 37 deletions
@@ -440,6 +440,9 @@ func validateRepositoryRemote(remote, access string) error {
if access == "ssh" && parsed.Scheme != "ssh" {
return errors.New("workspaceRepository remote does not match SSH access")
}
if parsed.Port() != "" && !(parsed.Scheme == "https" && parsed.Port() == "443") {
return errors.New("workspaceRepository remote uses a port unsupported by the runtime registry")
}
return nil
}
@@ -490,3 +490,11 @@ func containsSequence(values, wanted []string) bool {
}
return false
}
func TestPreparedGitRemoteRejectsPortsUnsupportedByRuntimeRegistry(t *testing.T) {
if validateRepositoryRemote("https://git.example.test:8443/workspaces.git", "https") == nil {
t.Fatal("runtime-rejected Git port accepted during document preparation")
}
if err := validateRepositoryRemote("https://git.example.test:443/workspaces.git", "https"); err != nil {
t.Fatal("standard HTTPS port must match URL normalization")
}
}