One sometimes has the need to be very strict on which types of "Things" should be creatable in Ditto.
There are already configuration options to only allow creation of things in certain defined namespaces - it can also be configured which authenticated subjects may create new things.
What however is not yet possible to define is to enforce that a "definition" must be provided when creating a thing.
Together with the WoT (Web of Things) based validation, providing such a configuration option would enable that the administrator / operator of Ditto has much control over what kind of things get created.
Suggestion for providing this configuration would be to extend the existing entity-creation config:
ditto.entity-creation {
# this default entry allows every authenticated "auth-subject" to create any "resource-type" in any "namespace":
grant = [
{
resource-types = [
"thing"
]
namespaces = [
"org.eclipse.ditto*"
]
auth-subjects = [
"pre:ditto-*"
]
# thing-definitions would only be applied for "thing" resources:
thing-definitions= [
null, # defining null would allow also to provide no definition - if this is missing from the list, a definition has to be provided
"https://eclipse-ditto.github.io/ditto-examples/wot/models/floor-lamp-*"
]
}
]
}