opsmill / infrahub

Infrahub - A new approach to Infrastructure Management
https://opsmill.com/
GNU Affero General Public License v3.0
196 stars 11 forks source link

feature: ability to define a item type for attributes of kind list #3931

Open wvandeun opened 2 months ago

wvandeun commented 2 months ago

Component

API Server / GraphQL

Describe the Feature Request

We should be able to define an item type for attributes of the list kind in the schema. For example, a user might want to create an attribute on a node of kind list, but the items in the list need to be an IP address, or numbers, or ... List[IPHost], List[Number], ...

Describe the Use Case

I want to be able to store IP prefixes in an attribute of a service level object, the prefixes represent a list of IP addresses that are available for the service to create.

Today I would be able to define an attribute of kind list, but it is not possible to force validation of the item types.

Another use case is a list of IP addresses you want to store for a whitelist.

Additional Information

No response

wvandeun commented 2 months ago

For the item type we should also be able to define more complex constraints, like the max_length or min_length of a Text kind.

dgarros commented 1 month ago

depends on #4246