distribution/registry/api/v2
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
..
descriptors.go Fix runaway allocation on /v2/_catalog 2023-04-24 18:53:43 +02:00
doc.go Move registry api definitions under registry package 2015-02-10 17:32:22 -08:00
errors.go Fix runaway allocation on /v2/_catalog 2023-04-24 18:53:43 +02:00
headerparser.go Honor X-Forwarded-Port and Forwarded headers 2016-11-02 16:49:42 +01:00
headerparser_test.go Honor X-Forwarded-Port and Forwarded headers 2016-11-02 16:49:42 +01:00
routes.go Enable struct check 2018-08-06 13:55:43 -07:00
routes_test.go api: url typo in specification 2017-07-18 14:48:55 -07:00
urls.go Fix gometalint errors 2021-03-23 21:03:10 +08:00
urls_test.go Fix gometalint errors 2021-03-23 21:03:10 +08:00