distribution/registry/api/v2
Jose D. Gomez R 4c1561e9fb
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, an error response 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>
2023-03-31 13:17:43 +02:00
..
descriptors.go Fix runaway allocation on /v2/_catalog 2023-03-31 13:17: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-03-31 13:17:43 +02:00
fuzz_test.go Fuzzing: Rewrite existing fuzzers to native go fuzzers 2022-11-12 17:30:10 +00: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 Do not recreate mux router for each incoming request 2022-07-08 14:17:17 -07:00
routes_test.go format code with gofumpt 2022-11-03 22:48:20 +01:00
urls.go replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01:00
urls_test.go Add tests for tags list pagination 2021-05-22 15:31:18 +01:00