distribution/registry
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
..
api Fix runaway allocation on /v2/_catalog 2023-03-31 13:17:43 +02:00
auth replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01:00
client Merge pull request #3788 from thaJeztah/deprecate_ReadSeekCloser 2022-11-18 08:53:15 +00:00
handlers Fix runaway allocation on /v2/_catalog 2023-03-31 13:17:43 +02:00
listener [Server] Listen and serve on a unix socket 2015-05-11 16:00:14 +03:00
middleware format code with gofumpt 2022-11-03 22:48:20 +01:00
proxy Merge pull request #3787 from thaJeztah/simplify_mocks 2022-11-18 08:53:26 +00:00
storage registry/storage: rename variables that collided with imports 2022-11-28 10:08:05 +01:00
doc.go Move initialization code from main.go to the registry package 2015-09-09 14:39:31 -07:00
registry.go Merge pull request #3772 from thaJeztah/registry_logging_simplify 2022-11-08 09:17:20 +01:00
registry_test.go replace deprecated io/ioutil 2022-11-04 23:47:52 +01:00
root.go format code with gofumpt 2022-11-03 22:48:20 +01:00