Add connector v2 admin operations

This commit is contained in:
Codex
2026-06-09 17:52:15 +02:00
parent d6448af1ec
commit 3c4c3003f7
4 changed files with 331 additions and 24 deletions

View File

@@ -28,3 +28,33 @@ func TestValidateFirstPartyManifests(t *testing.T) {
}
}
}
func TestValidateV2ManifestRequiresRuntimeMetadata(t *testing.T) {
raw, err := os.ReadFile(filepath.Clean("../../../connectors/github/attesto.connector.json"))
if err != nil {
t.Fatal(err)
}
var manifest Manifest
if err := json.Unmarshal(raw, &manifest); err != nil {
t.Fatal(err)
}
if manifest.SchemaVersion != "attesto.connector.v2" {
t.Fatalf("unexpected schema version: %s", manifest.SchemaVersion)
}
manifest.Runtime = nil
result := ValidateManifest(manifest)
if result.OK {
t.Fatalf("expected invalid manifest without runtime metadata")
}
var found bool
for _, finding := range result.Findings {
if finding.Code == "runtime.incomplete" {
found = true
}
}
if !found {
t.Fatalf("missing runtime finding: %+v", result.Findings)
}
}