performFallbackValidation performs the common fallback validation logic Note: This function now only handles the VSA result logic, image validation is handled in CLI layer
(result *ValidationResult, predicateStatus string)
| 84 | // performFallbackValidation performs the common fallback validation logic |
| 85 | // Note: This function now only handles the VSA result logic, image validation is handled in CLI layer |
| 86 | func PerformFallbackValidation(result *ValidationResult, predicateStatus string) *FallbackResult { |
| 87 | // Use the actual VSA result for fallback case |
| 88 | // If we have a result, use it; otherwise create a minimal result |
| 89 | var vsaResult *ValidationResult |
| 90 | if result != nil { |
| 91 | vsaResult = result |
| 92 | } else { |
| 93 | // Create a minimal result for cases where VSA retrieval completely failed |
| 94 | vsaResult = &ValidationResult{ |
| 95 | Passed: false, |
| 96 | Message: "VSA validation failed", |
| 97 | SignatureVerified: false, |
| 98 | PredicateOutcome: predicateStatus, |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | return &FallbackResult{ |
| 103 | FallbackOutput: nil, // Will be set by CLI layer |
| 104 | VSAResult: vsaResult, |
| 105 | Error: nil, |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | // createFallbackValidationContext precomputes the fallback validation context once |
| 110 | func CreateFallbackValidationContext(ctx context.Context, config *FallbackConfig) (*FallbackValidationContext, error) { |
no outgoing calls