MCPcopy Create free account
hub / github.com/conforma/cli / GenerateAndWriteSnapshotPredicate

Function GenerateAndWriteSnapshotPredicate

internal/validate/vsa/orchestrator.go:40–50  ·  view source on GitHub ↗

GenerateAndWriteSnapshotPredicate generates a snapshot Predicate and writes it to a file, returning the written path.

(ctx context.Context, generator *applicationsnapshot.SnapshotPredicateGenerator, writer *applicationsnapshot.SnapshotPredicateWriter)

Source from the content-addressed store, hash-verified

38
39// GenerateAndWriteSnapshotPredicate generates a snapshot Predicate and writes it to a file, returning the written path.
40func 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.
53func AttestVSA(ctx context.Context, attestor PredicateAttestor) (string, error) {

Callers 1

ProcessSnapshotVSAMethod · 0.85

Calls 2

GeneratePredicateMethod · 0.65
WritePredicateMethod · 0.65

Tested by

no test coverage detected