MCPcopy
hub / github.com/perkeep/perkeep / verifySignature

Method verifySignature

pkg/index/receive.go:316–331  ·  view source on GitHub ↗
(ctx context.Context, fetcher *missTrackFetcher, schemaBlob *schema.Blob)

Source from the content-addressed store, hash-verified

314}
315
316func (ix *Index) verifySignature(ctx context.Context, fetcher *missTrackFetcher, schemaBlob *schema.Blob) (*jsonsign.VerifyRequest, error) {
317 tf := &trackErrorsFetcher{f: fetcher}
318 vr := jsonsign.NewVerificationRequest(schemaBlob.JSON(), blob.NewSerialFetcher(ix.KeyFetcher, tf))
319 _, err := vr.Verify(ctx)
320
321 if err != nil {
322 // TODO(bradfitz): ask if the vr.Err.(jsonsign.Error).IsPermanent() and retry
323 // later if it's not permanent?
324 if tf.hasErrNotExist() {
325 return nil, errMissingDep
326 }
327 return nil, err
328 }
329
330 return vr, nil
331}
332
333func (ix *Index) populateMutationMapForSchema(ctx context.Context, fetcher *missTrackFetcher, schemaBlob *schema.Blob, mm *mutationMap) error {
334 switch schemaBlob.Type() {

Callers 1

Calls 5

hasErrNotExistMethod · 0.95
NewVerificationRequestFunction · 0.92
NewSerialFetcherFunction · 0.92
VerifyMethod · 0.80
JSONMethod · 0.45

Tested by

no test coverage detected