Validate digest length on parsing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
c0d094a72a
commit
1f5f9bad39
3 changed files with 26 additions and 26 deletions
|
@ -385,15 +385,15 @@ func TestLinkPathFuncs(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
repo: "foo/bar",
|
||||
digest: "sha256:deadbeaf",
|
||||
digest: "sha256:deadbeaf98fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
linkPathFn: blobLinkPath,
|
||||
expected: "/docker/registry/v2/repositories/foo/bar/_layers/sha256/deadbeaf/link",
|
||||
expected: "/docker/registry/v2/repositories/foo/bar/_layers/sha256/deadbeaf98fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/link",
|
||||
},
|
||||
{
|
||||
repo: "foo/bar",
|
||||
digest: "sha256:deadbeaf",
|
||||
digest: "sha256:deadbeaf98fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
linkPathFn: manifestRevisionLinkPath,
|
||||
expected: "/docker/registry/v2/repositories/foo/bar/_manifests/revisions/sha256/deadbeaf/link",
|
||||
expected: "/docker/registry/v2/repositories/foo/bar/_manifests/revisions/sha256/deadbeaf98fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/link",
|
||||
},
|
||||
} {
|
||||
p, err := testcase.linkPathFn(testcase.repo, testcase.digest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue