distribution/registry/handlers
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_test.go Fix runaway allocation on /v2/_catalog 2023-03-31 13:17:43 +02:00
app.go Merge pull request #3766 from thaJeztah/gofumpt 2022-11-04 12:19:53 +01:00
app_test.go Merge pull request #3766 from thaJeztah/gofumpt 2022-11-04 12:19:53 +01:00
basicauth.go bump up golang v1.17 2021-10-27 15:51:30 +08:00
basicauth_prego14.go bump up golang v1.17 2021-10-27 15:51:30 +08:00
blob.go use http consts for request methods 2022-11-02 23:31:47 +01:00
blobupload.go Merge pull request #3766 from thaJeztah/gofumpt 2022-11-04 12:19:53 +01:00
catalog.go Fix runaway allocation on /v2/_catalog 2023-03-31 13:17:43 +02:00
context.go go.mod: change imports to github.com/distribution/distribution/v3 2021-02-08 18:30:46 +01:00
health_test.go replace deprecated io/ioutil 2022-11-04 23:47:52 +01:00
helpers.go replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01: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 replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01:00
mail.go Fix gometalint errors 2019-02-04 16:01:04 -08:00
manifests.go Merge pull request #3766 from thaJeztah/gofumpt 2022-11-04 12:19:53 +01:00
tags.go use http consts for request methods 2022-11-02 23:31:47 +01:00