MCPcopy Index your code
hub / github.com/cli/cli / NewDigestedArtifact

Function NewDigestedArtifact

pkg/cmd/attestation/artifact/artifact.go:64–74  ·  view source on GitHub ↗
(client oci.Client, reference, digestAlg string)

Source from the content-addressed store, hash-verified

62}
63
64func NewDigestedArtifact(client oci.Client, reference, digestAlg string) (artifact *DigestedArtifact, err error) {
65 normalized, artifactType, err := normalizeReference(reference, os.PathSeparator)
66 if err != nil {
67 return nil, err
68 }
69 if artifactType == ociArtifactType {
70 // TODO: should we allow custom digestAlg for OCI artifacts?
71 return digestContainerImageArtifact(normalized, client)
72 }
73 return digestLocalFileArtifact(normalized, digestAlg)
74}
75
76// Digest returns the artifact's digest
77func (a *DigestedArtifact) Digest() string {

Callers 4

verifyAssetRunFunction · 0.92
TestLiveSigstoreVerifierFunction · 0.92
publicGoodPolicyFunction · 0.92
TestVerifyAttestationsFunction · 0.92

Calls 3

normalizeReferenceFunction · 0.85
digestLocalFileArtifactFunction · 0.85

Tested by 3

TestLiveSigstoreVerifierFunction · 0.74
publicGoodPolicyFunction · 0.74
TestVerifyAttestationsFunction · 0.74