distribution/registry/handlers
Jose D. Gomez R 521ea3d973
Fix runaway allocation on /v2/_catalog
Introduced a Catalog entry in the configuration struct. With it,
it's possible to control the maximum amount of entries returned
by /v2/catalog (`GetCatalog` in registry/handlers/catalog.go).

It's set to a default value of 1000.

`GetCatalog` returns 100 entries by default if no `n` is
provided. When provided it will be validated to be between `0`
and `MaxEntries` defined in Configuration. When `n` is outside
the aforementioned boundary, ErrorCodePaginationNumberInvalid is
returned.

`GetCatalog` now handles `n=0` gracefully with an empty response
as well.

Signed-off-by: José D. Gómez R. <1josegomezr@gmail.com>
Co-authored-by: Cory Snider <corhere@gmail.com>
2023-04-24 18:53:43 +02:00
..
api_test.go Fix runaway allocation on /v2/_catalog 2023-04-24 18:53:43 +02:00
app.go fix go check issues 2021-11-16 17:46:08 +08:00
app_test.go Migrate to golangci-lint 2021-03-23 21:02:54 +08:00
basicauth.go Move registry package into handler package 2015-02-10 17:25:40 -08:00
basicauth_prego14.go Move registry package into handler package 2015-02-10 17:25:40 -08:00
blob.go Migrate to golangci-lint 2021-03-23 21:02:54 +08:00
blobupload.go Fix gosimple checks 2021-03-23 21:03:20 +08:00
catalog.go Fix runaway allocation on /v2/_catalog 2023-04-24 18:53:43 +02:00
context.go Migrate to golangci-lint 2021-03-23 21:02:54 +08:00
health_test.go Disable upload purging during test 2016-08-26 16:23:07 -07:00
helpers.go remove closenotifier 2018-09-11 16:14:10 -07:00
hmac.go handlers: provide better log message on mismatched secret 2016-09-02 15:24:35 -07:00
hmac_test.go Refactor Blob Service API 2015-05-15 17:05:18 -07:00
hooks.go Fix gometalint errors 2021-03-23 21:03:10 +08:00
mail.go Fix gometalint errors 2021-03-23 21:03:10 +08:00
manifests.go Migrate to golangci-lint 2021-03-23 21:02:54 +08:00
tags.go Migrate to golangci-lint 2021-03-23 21:02:54 +08:00