Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define sane limits on the repository name #530

Closed
ozairasim opened this issue Mar 20, 2024 · 3 comments · Fixed by #542
Closed

Define sane limits on the repository name #530

ozairasim opened this issue Mar 20, 2024 · 3 comments · Fixed by #542

Comments

@ozairasim
Copy link

https://github.com/distribution/distribution currently defines a limit of 255 on the repository name. Until recently it was also including the domain length in the repository name limit calculation which is being addressed in distribution/reference#9.

It would also be beneficial to document these limits in the spec officially so there is less confusion on should be the limits for repository name and the domain. Common registries also have enforced limits on the repository name. For example:

@sudo-bmitch
Copy link
Contributor

I'm really torn on this one. Lots of registries have various restrictions, like character restrictions on user names, that impact the repository name in a way I don't think we want to include in the spec. And yet this is a limit that has existed for at least 9 years in a widely copied and imported implementation of the "reference".

Are there technical reasons that we need to limit this to 255? Is there a risk that registries will come along in the future and want a larger limit?

I feel like the safest option is to allow clients to send request for any length of repository, and registries can implement individual limits. That makes it easier for the registry to increase that limit in the future without requiring every client to upgrade.

@tianon
Copy link
Member

tianon commented Mar 22, 2024

Perhaps some advisory text about 255 being a good limit for clients/content producers if they want maximum compatibility/portability, similar to the 4MiB maximum suggestion?

(ie, for registries that want to implement a limit, it should not be LESS than 255, or something like that?)

@sudo-bmitch
Copy link
Contributor

Perhaps an implementers note for registries. They should avoid allowing repositories plus a hostname more than 255 characters long to support older clients. And clients should avoid length limits to support future registries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants