MCPcopy Create free account
hub / github.com/containers/image / lookasideStorageURL

Function lookasideStorageURL

docker/registries_d.go:296–303  ·  view source on GitHub ↗

lookasideStorageURL returns an URL usable for accessing signature index in base with known manifestDigest. base is not nil from the caller NOTE: Keep this in sync with docs/signature-protocols.md!

(base lookasideStorageBase, manifestDigest digest.Digest, index int)

Source from the content-addressed store, hash-verified

294// base is not nil from the caller
295// NOTE: Keep this in sync with docs/signature-protocols.md!
296func lookasideStorageURL(base lookasideStorageBase, manifestDigest digest.Digest, index int) (*url.URL, error) {
297 if err := manifestDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in a path with ../, so validate explicitly.
298 return nil, err
299 }
300 sigURL := *base
301 sigURL.Path = fmt.Sprintf("%s@%s=%s/signature-%d", sigURL.Path, manifestDigest.Algorithm(), manifestDigest.Encoded(), index+1)
302 return &sigURL, nil
303}

Callers 4

TestLookasideStorageURLFunction · 0.85
deleteImageFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestLookasideStorageURLFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…