fix: remove unsupported map fallback in policy result parsing

This commit is contained in:
Ritesh
2026-03-25 14:47:04 +05:30
parent 13a7a18e17
commit 97e63cf7d2
2 changed files with 26 additions and 6 deletions

View File

@@ -332,14 +332,8 @@ func extractViolations(rs rego.ResultSet) ([]string, error) {
}
}
case map[string]interface{}:
// Check for structured result: {"valid": bool, "violations": [...]}
if vs := extractStructuredViolations(v); vs != nil {
violations = append(violations, vs...)
} else {
// Fallback: OPA sometimes returns sets as maps with string keys
for key := range v {
violations = append(violations, key)
}
}
}
}