GenerateAndWriteSnapshotPredicate generates a snapshot Predicate and writes it to a file, returning the written path.
(ctx context.Context, generator *applicationsnapshot.SnapshotPredicateGenerator, writer *applicationsnapshot.SnapshotPredicateWriter)
| 38 | |
| 39 | // GenerateAndWriteSnapshotPredicate generates a snapshot Predicate and writes it to a file, returning the written path. |
| 40 | func GenerateAndWriteSnapshotPredicate(ctx context.Context, generator *applicationsnapshot.SnapshotPredicateGenerator, writer *applicationsnapshot.SnapshotPredicateWriter) (string, error) { |
| 41 | pred, err := generator.GeneratePredicate(ctx) |
| 42 | if err != nil { |
| 43 | return "", err |
| 44 | } |
| 45 | writtenPath, err := writer.WritePredicate(pred) |
| 46 | if err != nil { |
| 47 | return "", err |
| 48 | } |
| 49 | return writtenPath, nil |
| 50 | } |
| 51 | |
| 52 | // AttestVSA handles VSA attestation and envelope writing for the target component. |
| 53 | func AttestVSA(ctx context.Context, attestor PredicateAttestor) (string, error) { |
no test coverage detected