distribution/configuration
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
..
configuration.go Fix runaway allocation on /v2/_catalog 2023-03-31 13:17:43 +02:00
configuration_test.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
parser.go replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01:00
parser_test.go Add tests for configuration parser 2017-11-15 17:01:19 +01:00