middleware icon indicating copy to clipboard operation
middleware copied to clipboard

NAS-129794 / 24.10 / Use pre-defined constant for UID validator

Open anodos325 opened this issue 1 year ago • 3 comments

We shouldn't have second definition of TRUENAS_IDMAP_DEFAULT_LOW.

anodos325 avatar Jun 28 '24 15:06 anodos325

Jira URL: https://ixsystems.atlassian.net/browse/NAS-129794

bugclerk avatar Jun 28 '24 15:06 bugclerk

Changing it there will retroactively change API definition for already released APIs, that should not be the case.

If it is not a part of API definition, let's validate it in the code, not in the API definitions,

Obviously if someone is changing constants they'll need to be aware of its impact on other areas of the product. I don't see any reason to legitimately allow different ID ranges based on which endpoint an API consumer chooses to use.

anodos325 avatar Jun 28 '24 16:06 anodos325

if someone is changing constants they'll need to be aware of its impact on other areas of the product.

We took an obligation to have backwards-compatible API. One of the methods we decided to use in order to comply with it is to never import anything in the API definition.

This value should probably be validated in the create/update method itself, not in the API schema.

themylogin avatar Jul 01 '24 16:07 themylogin