SoftwareAG / cumulocity-digital-twin-manager

The Digital Twin Manager enables you to create and manage assets around your physical connected devices in Cumulocity IoT.
Apache License 2.0
10 stars 4 forks source link

Suggestion: Custom properties - Blacklist certain Keys #34

Closed CGuether closed 5 months ago

CGuether commented 1 year ago

If a user defines a custom property he is free to decide how to name it and what key should be used. The key is used as property name in the data model of the asset, which is created based on this custom property. As there aren't any limitations to what keys the user can define, he could use keys, which are already used as built-in properties. This can result in strange side effects.

For example if the user defines a custom property, which has the key type, he could by accident override the built-in property type, which is used to identify the asset type. There should be a blacklist, which contains keys, which must not be used by users and are marked as built-in.

dchc01 commented 5 months ago

The implementation is complete. Here is the list of blacklisted keys: 'c8y_Notes', 'c8y_IsAssetProperty', 'c8y_JsonSchema', 'c8y_IsAssetType', 'c8y_IsAsset', 'c8y_IsDeviceGroup', 'c8y_Global', 'c8y_Position', 'additionParents', 'assetParents', 'allowedAssetTypes', 'id', 'icon', 'category', 'name', 'isNoneChildAssetsAllowed', 'properties', 'childAdditions', 'childAssets', 'childDevices', 'creationTime', 'description', 'deviceParents', 'label', 'lastUpdated', 'owner', 'self', 'type', 'customProperties', 'pagination', 'currentPage', 'nextPage', 'pageSize', 'key', 'assetModels', 'depth', 'assetProperties', 'tags'