Add connector v2 admin operations
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user