diff --git a/deployment/helm/ditto/Chart.yaml b/deployment/helm/ditto/Chart.yaml index d4ef488ff8..e429161e36 100644 --- a/deployment/helm/ditto/Chart.yaml +++ b/deployment/helm/ditto/Chart.yaml @@ -16,7 +16,7 @@ description: | A digital twin is a virtual, cloud based, representation of his real world counterpart (real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc). type: application -version: 3.5.12 # chart version is effectively set by release-job +version: 3.5.13 # chart version is effectively set by release-job appVersion: 3.5.10 keywords: - iot-chart diff --git a/deployment/helm/ditto/local-values.yaml b/deployment/helm/ditto/local-values.yaml index f0a74b06ba..62b8d560c3 100644 --- a/deployment/helm/ditto/local-values.yaml +++ b/deployment/helm/ditto/local-values.yaml @@ -69,6 +69,26 @@ things: - "org.eclipse.ditto.room" authSubjects: - "connection:some" + wot: + tmValidation: + dynamicConfig: + - validationContext: + dittoHeadersPatterns: + - ditto-originator: "connection:one" + thingDefinitionPatterns: + - "^foo.*bar$" + featureDefinitionPatterns: [ ] + configOverrides: + enabled: true + thing: + enforce: + thing-description-modification: false + attributes: true + forbid: + thing-description-deletion: false + feature: + enforce: + feature-description-modification: false ## ---------------------------------------------------------------------------- ## things-search configuration diff --git a/deployment/helm/ditto/templates/things-deployment.yaml b/deployment/helm/ditto/templates/things-deployment.yaml index ad29bbaeeb..96f05a73b2 100644 --- a/deployment/helm/ditto/templates/things-deployment.yaml +++ b/deployment/helm/ditto/templates/things-deployment.yaml @@ -162,6 +162,36 @@ spec: {{- end }} {{- end }} '-Dditto.things.wot.to-thing-description.json-template={{ .Values.things.config.wot.tdJsonTemplate | replace "\n" "" | replace "\\\"" "\"" }}' + {{- range $dynConfIdx, $dynamicWotTmValidationConfig := .Values.things.config.wot.tmValidation.dynamicConfig }} + {{- if or (gt (len $dynamicWotTmValidationConfig.validationContext.dittoHeadersPatterns) 0) (gt (len $dynamicWotTmValidationConfig.validationContext.thingDefinitionPatterns) 0) (gt (len $dynamicWotTmValidationConfig.validationContext.featureDefinitionPatterns) 0) }} + {{- range $dhpIdx, $dittoHeadersPatterns := $dynamicWotTmValidationConfig.validationContext.dittoHeadersPatterns }} + {{- range $dhpKey, $dhpVal := $dittoHeadersPatterns }} + "{{ printf "%s%d%s%d%s%s=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".validation-context.ditto-headers-patterns." $dhpIdx "." $dhpKey $dhpVal }}" + {{- end }} + {{- end }} + {{- range $tdpIdx, $thingDefinitionPattern := $dynamicWotTmValidationConfig.validationContext.thingDefinitionPatterns }} + "{{ printf "%s%d%s%d=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".validation-context.thing-definition-patterns." $tdpIdx $thingDefinitionPattern }}" + {{- end }} + {{- range $fdpIdx, $featureDefinitionPattern := $dynamicWotTmValidationConfig.validationContext.featureDefinitionPatterns }} + "{{ printf "%s%d%s%d=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".validation-context.feature-definition-patterns." $fdpIdx $featureDefinitionPattern }}" + {{- end }} + {{- range $configOverridesKey, $configOverridesValue := $dynamicWotTmValidationConfig.configOverrides }} + {{- if or (eq (kindOf $configOverridesValue) "map") (eq (kindOf $configOverridesValue) "slice") }} + {{- range $nested1ConfigOverridesKey, $nested1ConfigOverridesValue := $configOverridesValue }} + {{- if or (eq (kindOf $nested1ConfigOverridesValue) "map") (eq (kindOf $nested1ConfigOverridesValue) "slice") }} + {{- range $nested2ConfigOverridesKey, $nested2ConfigOverridesValue := $nested1ConfigOverridesValue }} + "{{ printf "%s%d%s%s%s%s%s%s=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".config-overrides." $configOverridesKey "." $nested1ConfigOverridesKey "." $nested2ConfigOverridesKey $nested2ConfigOverridesValue }}" + {{- end }} + {{- else }} + "{{ printf "%s%d%s%s%s%s=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".config-overrides." $configOverridesKey "." $nested1ConfigOverridesKey $nested1ConfigOverridesValue }}" + {{- end }} + {{- end }} + {{- else }} + "{{ printf "%s%d%s%s=%v" "-Dditto.things.wot.tm-model-validation.dynamic-configuration." $dynConfIdx ".config-overrides." $configOverridesKey $configOverridesValue }}" + {{- end }} + {{- end }} + {{- end }} + {{- end }} {{ join " " .Values.things.systemProps }} - name: MONGO_DB_SSL_ENABLED value: "{{ printf "%t" .Values.dbconfig.things.ssl }}" @@ -272,6 +302,52 @@ spec: value: "{{ .Values.things.config.policiesEnforcer.cache.expireAfterAccess }}" - name: THINGS_WOT_TO_THING_DESCRIPTION_BASE_PREFIX value: "{{ .Values.things.config.wot.tdBasePrefix }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_ENABLED + value: "{{ .Values.things.config.wot.tmValidation.enabled }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_TD_MODIFICATION + value: "{{ index .Values.things.config.wot.tmValidation.thing.enforce "thing-description-modification" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_ATTRIBUTES + value: "{{ .Values.things.config.wot.tmValidation.thing.enforce.attributes }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_INPUT + value: "{{ index .Values.things.config.wot.tmValidation.thing.enforce "inbox-messages-input" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_OUTPUT + value: "{{ index .Values.things.config.wot.tmValidation.thing.enforce "inbox-messages-output" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_OUTBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.thing.enforce "outbox-messages" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_TD_DELETION + value: "{{ index .Values.things.config.wot.tmValidation.thing.forbid "thing-description-deletion" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_ATTRIBUTES + value: "{{ index .Values.things.config.wot.tmValidation.thing.forbid "non-modeled-attributes" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_INBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.thing.forbid "non-modeled-inbox-messages" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_OUTBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.thing.forbid "non-modeled-outbox-messages" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_FD_MODIFICATION + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "feature-description-modification" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PRESENCE_OF_MODELED_FEATURES + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "presence-of-modeled-features" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PROPERTIES + value: "{{ .Values.things.config.wot.tmValidation.feature.enforce.properties }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_DESIRED_PROPERTIES + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "desired-properties" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_INPUT + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "inbox-messages-input" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_OUTPUT + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "inbox-messages-output" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_OUTBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.feature.enforce "outbox-messages" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_FD_DELETION + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "feature-description-deletion" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_INBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "non-modeled-inbox-messages" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_FEATURES + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "non-modeled-features" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_PROPERTIES + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "non-modeled-properties" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_DESIRED_PROPERTIES + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "non-modeled-desired-properties" }}" + - name: THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_OUTBOX_MESSAGES + value: "{{ index .Values.things.config.wot.tmValidation.feature.forbid "non-modeled-outbox-messages" }}" {{- if .Values.things.extraEnv }} {{- toYaml .Values.things.extraEnv | nindent 12 }} {{- end }} diff --git a/deployment/helm/ditto/values.yaml b/deployment/helm/ditto/values.yaml index 9304df45a8..892fd9e595 100644 --- a/deployment/helm/ditto/values.yaml +++ b/deployment/helm/ditto/values.yaml @@ -994,6 +994,69 @@ things: "security": "basic_sc", "support": "https://www.eclipse.dev/ditto/" } + # tmValidation provides configuration settings for WoT (Web of Things) integration regarding the validation of + # Things and Features based on their WoT ThingModels + tmValidation: + # enabled whether the ThingModel validation of Things/Features should be enabled + enabled: false + # thing provides configuration settings for WoT based validation of Things + thing: + # enforce holds all configuration relating to enforcing the model + enforce: + # thing-description-modification whether to enforce/validate a thing whenever its description is modified + thing-description-modification: true + # attributes whether to enforce/validate attributes of a thing following the defined WoT properties + attributes: true + # inbox-messages-input whether to enforce/validate inbox messages to a thing following the defined WoT action "input" + inbox-messages-input: true + # inbox-messages-output whether to enforce/validate inbox message responses to a thing following the defined WoT action "output" + inbox-messages-output: true + # outbox-messages whether to enforce/validate outbox messages from a thing following the defined WoT event "data" + outbox-messages: true + # forbid holds all configuration relating to forbidding/preventing certain interactions + forbid: + # thing-description-deletion whether to forbid deletion of a thing's description + thing-description-deletion: true + # non-modeled-attributes whether to forbid persisting attributes which are not defined as properties in the WoT model + non-modeled-attributes: true + # non-modeled-inbox-messages whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model + non-modeled-inbox-messages: true + # non-modeled-outbox-messages whether to forbid dispatching of outbox messages which are not defined as events in the WoT model + non-modeled-outbox-messages: true + # feature provides configuration settings for WoT based validation of Features + feature: + # enforce holds all configuration relating to enforcing the model + enforce: + # feature-description-modification whether to enforce/validate a feature whenever its description is modified + feature-description-modification: true + # presence-of-modeled-features whether to enforce that all modeled features + # (submodels referenced in the thing's definition's WoT model) are present + presence-of-modeled-features: true + # properties whether to enforce/validate properties of a feature following the defined WoT properties + properties: true + # desired-properties whether to enforce/validate desired properties of a feature following the defined WoT properties + desired-properties: true + # inbox-messages-input whether to enforce/validate inbox messages to a feature following the defined WoT action "input" + inbox-messages-input: true + # inbox-messages-output whether to enforce/validate inbox message responses to a feature following the defined WoT action "output" + inbox-messages-output: true + # outbox-messages whether to enforce/validate outbox messages from a feature following the defined WoT events + outbox-messages: true + # forbid holds all configuration relating to forbidding/preventing certain interactions + forbid: + # feature-description-deletion whether to forbid deletion of a feature's description + feature-description-deletion: true + # non-modeled-features whether to forbid adding features to a Thing which were not defined in its definition's WoT model + non-modeled-features: true + # non-modeled-properties whether to forbid persisting properties which are not defined as properties in the WoT model + non-modeled-properties: true + # non-modeled-desired-properties whether to forbid persisting desired properties which are not defined as properties in the WoT model + non-modeled-desired-properties: true + # non-modeled-inbox-messages whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model + non-modeled-inbox-messages: true + # non-modeled-outbox-messages whether to forbid dispatching of outbox messages which are not defined as events in the WoT model + non-modeled-outbox-messages: true + dynamicConfig: [] ## ---------------------------------------------------------------------------- ## things-search configuration diff --git a/things/service/src/main/resources/things.conf b/things/service/src/main/resources/things.conf index b4a618552b..a37cd1379b 100755 --- a/things/service/src/main/resources/things.conf +++ b/things/service/src/main/resources/things.conf @@ -282,77 +282,85 @@ ditto { enabled = ${?THINGS_WOT_TM_MODEL_VALIDATION_ENABLED} thing { - # whether to enforce a thing whenever the "definition" of the thing is updated to a new/other WoT TM - # needed follow-up would likely be https://github.com/eclipse-ditto/ditto/issues/1843 - # - only with that we would e.g. update all feature definitions to the ones of the new thing definitions - enforce-thing-description-modification = true - enforce-thing-description-modification = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_TD_MODIFICATION} + enforce { + # whether to enforce a thing whenever the "definition" of the thing is updated to a new/other WoT TM + # needed follow-up would likely be https://github.com/eclipse-ditto/ditto/issues/1843 + # - only with that we would e.g. update all feature definitions to the ones of the new thing definitions + thing-description-modification = true + thing-description-modification = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_TD_MODIFICATION} - forbid-thing-description-deletion = true - forbid-thing-description-deletion = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_TD_DELETION} + attributes = true + attributes = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_ATTRIBUTES} - enforce-attributes = true - enforce-attributes = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_ATTRIBUTES} + inbox-messages-input = true + inbox-messages-input = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_INPUT} - forbid-non-modeled-attributes = true - forbid-non-modeled-attributes = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_ATTRIBUTES} + inbox-messages-output = true + inbox-messages-output = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_OUTPUT} - enforce-inbox-messages-input = true - enforce-inbox-messages-input = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_INPUT} + outbox-messages = true + outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_OUTBOX_MESSAGES} + } - enforce-inbox-messages-output = true - enforce-inbox-messages-output = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_INBOX_MESSAGES_OUTPUT} + forbid { + thing-description-deletion = true + thing-description-deletion = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_TD_DELETION} - forbid-non-modeled-inbox-messages = true - forbid-non-modeled-inbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_INBOX_MESSAGES} + non-modeled-attributes = true + non-modeled-attributes = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_ATTRIBUTES} - enforce-outbox-messages = true - enforce-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_ENFORCE_OUTBOX_MESSAGES} + non-modeled-inbox-messages = true + non-modeled-inbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_INBOX_MESSAGES} - forbid-non-modeled-outbox-messages = true - forbid-non-modeled-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_OUTBOX_MESSAGES} + non-modeled-outbox-messages = true + non-modeled-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_THING_FORBID_NON_MODELED_OUTBOX_MESSAGES} + } } feature { - # whether to enforce a feature whenever the "definition"(s) of the feature is updated to a new/other WoT TM(s) - enforce-feature-description-modification = true - enforce-feature-description-modification = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_FD_MODIFICATION} + enforce { + # whether to enforce a feature whenever the "definition"(s) of the feature is updated to a new/other WoT TM(s) + feature-description-modification = true + feature-description-modification = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_FD_MODIFICATION} - forbid-feature-description-deletion = true - forbid-feature-description-deletion = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_FD_DELETION} + presence-of-modeled-features = true + presence-of-modeled-features = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PRESENCE_OF_MODELED_FEATURES} - enforce-presence-of-modeled-features = true - enforce-presence-of-modeled-features = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PRESENCE_OF_MODELED_FEATURES} + properties = true + properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PROPERTIES} - forbid-non-modeled-features = true - forbid-non-modeled-features = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_FEATURES} + desired-properties = true + desired-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_DESIRED_PROPERTIES} - enforce-properties = true - enforce-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_PROPERTIES} + inbox-messages-input = true + inbox-messages-input = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_INPUT} - forbid-non-modeled-properties = true - forbid-non-modeled-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_PROPERTIES} + inbox-messages-output = true + inbox-messages-output = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_OUTPUT} - enforce-desired-properties = true - enforce-desired-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_DESIRED_PROPERTIES} + outbox-messages = true + outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_OUTBOX_MESSAGES} + } - forbid-non-modeled-desired-properties = true - forbid-non-modeled-desired-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_DESIRED_PROPERTIES} + forbid { + feature-description-deletion = true + feature-description-deletion = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_FD_DELETION} - enforce-inbox-messages-input = true - enforce-inbox-messages-input = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_INPUT} + non-modeled-features = true + non-modeled-features = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_FEATURES} - enforce-inbox-messages-output = true - enforce-inbox-messages-output = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_INBOX_MESSAGES_OUTPUT} + non-modeled-properties = true + non-modeled-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_PROPERTIES} - forbid-non-modeled-inbox-messages = true - forbid-non-modeled-inbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_INBOX_MESSAGES} + non-modeled-desired-properties = true + non-modeled-desired-properties = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_DESIRED_PROPERTIES} - enforce-outbox-messages = true - enforce-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_ENFORCE_OUTBOX_MESSAGES} + non-modeled-inbox-messages = true + non-modeled-inbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_INBOX_MESSAGES} - forbid-non-modeled-outbox-messages = true - forbid-non-modeled-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_OUTBOX_MESSAGES} + non-modeled-outbox-messages = true + non-modeled-outbox-messages = ${?THINGS_WOT_TM_MODEL_VALIDATION_FEATURE_FORBID_NON_MODELED_OUTBOX_MESSAGES} + } } dynamic-configuration = [ @@ -375,7 +383,7 @@ ditto { // config-overrides { // enabled = true // thing { -// enforce-attributes = false +// enforce.attributes = false // } // feature { // diff --git a/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultFeatureValidationConfig.java b/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultFeatureValidationConfig.java index b8351282a5..7603dcc1b3 100644 --- a/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultFeatureValidationConfig.java +++ b/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultFeatureValidationConfig.java @@ -31,44 +31,44 @@ final class DefaultFeatureValidationConfig implements FeatureValidationConfig { private static final String CONFIG_PATH = "feature"; private final boolean enforceFeatureDescriptionModification; - private final boolean forbidFeatureDescriptionDeletion; private final boolean enforcePresenceOfModeledFeatures; - private final boolean forbidNonModeledFeatures; private final boolean enforceProperties; - private final boolean forbidNonModeledProperties; private final boolean enforceDesiredProperties; - private final boolean forbidNonModeledDesiredProperties; private final boolean enforceInboxMessagesInput; private final boolean enforceInboxMessagesOutput; - private final boolean forbidNonModeledInboxMessages; private final boolean enforceOutboxMessages; + private final boolean forbidFeatureDescriptionDeletion; + private final boolean forbidNonModeledFeatures; + private final boolean forbidNonModeledProperties; + private final boolean forbidNonModeledDesiredProperties; + private final boolean forbidNonModeledInboxMessages; private final boolean forbidNonModeledOutboxMessages; private DefaultFeatureValidationConfig(final ScopedConfig scopedConfig) { enforceFeatureDescriptionModification = scopedConfig.getBoolean(ConfigValue.ENFORCE_FEATURE_DESCRIPTION_MODIFICATION.getConfigPath()); - forbidFeatureDescriptionDeletion = - scopedConfig.getBoolean(ConfigValue.FORBID_FEATURE_DESCRIPTION_DELETION.getConfigPath()); enforcePresenceOfModeledFeatures = scopedConfig.getBoolean(ConfigValue.ENFORCE_PRESENCE_OF_MODELED_FEATURES.getConfigPath()); - forbidNonModeledFeatures = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_FEATURES.getConfigPath()); enforceProperties = scopedConfig.getBoolean(ConfigValue.ENFORCE_PROPERTIES.getConfigPath()); - forbidNonModeledProperties = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_PROPERTIES.getConfigPath()); enforceDesiredProperties = scopedConfig.getBoolean(ConfigValue.ENFORCE_DESIRED_PROPERTIES.getConfigPath()); - forbidNonModeledDesiredProperties = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_DESIRED_PROPERTIES.getConfigPath()); enforceInboxMessagesInput = scopedConfig.getBoolean(ConfigValue.ENFORCE_INBOX_MESSAGES_INPUT.getConfigPath()); enforceInboxMessagesOutput = scopedConfig.getBoolean(ConfigValue.ENFORCE_INBOX_MESSAGES_OUTPUT.getConfigPath()); - forbidNonModeledInboxMessages = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_INBOX_MESSAGES.getConfigPath()); enforceOutboxMessages = scopedConfig.getBoolean(ConfigValue.ENFORCE_OUTBOX_MESSAGES.getConfigPath()); + forbidFeatureDescriptionDeletion = + scopedConfig.getBoolean(ConfigValue.FORBID_FEATURE_DESCRIPTION_DELETION.getConfigPath()); + forbidNonModeledFeatures = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_FEATURES.getConfigPath()); + forbidNonModeledProperties = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_PROPERTIES.getConfigPath()); + forbidNonModeledDesiredProperties = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_DESIRED_PROPERTIES.getConfigPath()); + forbidNonModeledInboxMessages = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_INBOX_MESSAGES.getConfigPath()); forbidNonModeledOutboxMessages = scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_OUTBOX_MESSAGES.getConfigPath()); } @@ -91,58 +91,58 @@ public boolean isEnforceFeatureDescriptionModification() { } @Override - public boolean isForbidFeatureDescriptionDeletion() { - return forbidFeatureDescriptionDeletion; + public boolean isEnforcePresenceOfModeledFeatures() { + return enforcePresenceOfModeledFeatures; } @Override - public boolean isEnforcePresenceOfModeledFeatures() { - return enforcePresenceOfModeledFeatures; + public boolean isEnforceProperties() { + return enforceProperties; } @Override - public boolean isForbidNonModeledFeatures() { - return forbidNonModeledFeatures; + public boolean isEnforceDesiredProperties() { + return enforceDesiredProperties; } @Override - public boolean isEnforceProperties() { - return enforceProperties; + public boolean isEnforceInboxMessagesInput() { + return enforceInboxMessagesInput; } @Override - public boolean isForbidNonModeledProperties() { - return forbidNonModeledProperties; + public boolean isEnforceInboxMessagesOutput() { + return enforceInboxMessagesOutput; } @Override - public boolean isEnforceDesiredProperties() { - return enforceDesiredProperties; + public boolean isEnforceOutboxMessages() { + return enforceOutboxMessages; } @Override - public boolean isForbidNonModeledDesiredProperties() { - return forbidNonModeledDesiredProperties; + public boolean isForbidFeatureDescriptionDeletion() { + return forbidFeatureDescriptionDeletion; } @Override - public boolean isEnforceInboxMessagesInput() { - return enforceInboxMessagesInput; + public boolean isForbidNonModeledFeatures() { + return forbidNonModeledFeatures; } @Override - public boolean isEnforceInboxMessagesOutput() { - return enforceInboxMessagesOutput; + public boolean isForbidNonModeledProperties() { + return forbidNonModeledProperties; } @Override - public boolean isForbidNonModeledInboxMessages() { - return forbidNonModeledInboxMessages; + public boolean isForbidNonModeledDesiredProperties() { + return forbidNonModeledDesiredProperties; } @Override - public boolean isEnforceOutboxMessages() { - return enforceOutboxMessages; + public boolean isForbidNonModeledInboxMessages() { + return forbidNonModeledInboxMessages; } @Override @@ -180,16 +180,16 @@ public int hashCode() { public String toString() { return getClass().getSimpleName() + " [" + "enforcePresenceOfModeledFeatures=" + enforcePresenceOfModeledFeatures + - ", forbidFeatureDescriptionDeletion=" + forbidFeatureDescriptionDeletion + - ", forbidNonModeledFeatures=" + forbidNonModeledFeatures + ", enforceProperties=" + enforceProperties + - ", forbidNonModeledProperties=" + forbidNonModeledProperties + ", enforceDesiredProperties=" + enforceDesiredProperties + - ", forbidNonModeledDesiredProperties=" + forbidNonModeledDesiredProperties + ", enforceInboxMessagesInput=" + enforceInboxMessagesInput + ", enforceInboxMessagesOutput=" + enforceInboxMessagesOutput + - ", forbidNonModeledInboxMessages=" + forbidNonModeledInboxMessages + ", enforceOutboxMessages=" + enforceOutboxMessages + + ", forbidFeatureDescriptionDeletion=" + forbidFeatureDescriptionDeletion + + ", forbidNonModeledFeatures=" + forbidNonModeledFeatures + + ", forbidNonModeledProperties=" + forbidNonModeledProperties + + ", forbidNonModeledDesiredProperties=" + forbidNonModeledDesiredProperties + + ", forbidNonModeledInboxMessages=" + forbidNonModeledInboxMessages + ", forbidNonModeledOutboxMessages=" + forbidNonModeledOutboxMessages + "]"; } diff --git a/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultThingValidationConfig.java b/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultThingValidationConfig.java index 0a5fae363b..dc65074c38 100644 --- a/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultThingValidationConfig.java +++ b/wot/api/src/main/java/org/eclipse/ditto/wot/api/config/DefaultThingValidationConfig.java @@ -31,32 +31,32 @@ final class DefaultThingValidationConfig implements ThingValidationConfig { private static final String CONFIG_PATH = "thing"; private final boolean enforceThingDescriptionModification; - private final boolean forbidThingDescriptionDeletion; private final boolean enforceAttributes; - private final boolean forbidNonModeledAttributes; private final boolean enforceInboxMessagesInput; private final boolean enforceInboxMessagesOutput; - private final boolean forbidNonModeledInboxMessages; private final boolean enforceOutboxMessages; + private final boolean forbidThingDescriptionDeletion; + private final boolean forbidNonModeledAttributes; + private final boolean forbidNonModeledInboxMessages; private final boolean forbidNonModeledOutboxMessages; private DefaultThingValidationConfig(final ScopedConfig scopedConfig) { enforceThingDescriptionModification = scopedConfig.getBoolean(ConfigValue.ENFORCE_THING_DESCRIPTION_MODIFICATION.getConfigPath()); - forbidThingDescriptionDeletion = - scopedConfig.getBoolean(ConfigValue.FORBID_THING_DESCRIPTION_DELETION.getConfigPath()); enforceAttributes = scopedConfig.getBoolean(ConfigValue.ENFORCE_ATTRIBUTES.getConfigPath()); - forbidNonModeledAttributes = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_ATTRIBUTES.getConfigPath()); enforceInboxMessagesInput = scopedConfig.getBoolean(ConfigValue.ENFORCE_INBOX_MESSAGES_INPUT.getConfigPath()); enforceInboxMessagesOutput = scopedConfig.getBoolean(ConfigValue.ENFORCE_INBOX_MESSAGES_OUTPUT.getConfigPath()); - forbidNonModeledInboxMessages = - scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_INBOX_MESSAGES.getConfigPath()); enforceOutboxMessages = scopedConfig.getBoolean(ConfigValue.ENFORCE_OUTBOX_MESSAGES.getConfigPath()); + forbidThingDescriptionDeletion = + scopedConfig.getBoolean(ConfigValue.FORBID_THING_DESCRIPTION_DELETION.getConfigPath()); + forbidNonModeledAttributes = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_ATTRIBUTES.getConfigPath()); + forbidNonModeledInboxMessages = + scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_INBOX_MESSAGES.getConfigPath()); forbidNonModeledOutboxMessages = scopedConfig.getBoolean(ConfigValue.FORBID_NON_MODELED_OUTBOX_MESSAGES.getConfigPath()); } @@ -78,21 +78,11 @@ public boolean isEnforceThingDescriptionModification() { return enforceThingDescriptionModification; } - @Override - public boolean isForbidThingDescriptionDeletion() { - return forbidThingDescriptionDeletion; - } - @Override public boolean isEnforceAttributes() { return enforceAttributes; } - @Override - public boolean isForbidNonModeledAttributes() { - return forbidNonModeledAttributes; - } - @Override public boolean isEnforceInboxMessagesInput() { return enforceInboxMessagesInput; @@ -104,13 +94,23 @@ public boolean isEnforceInboxMessagesOutput() { } @Override - public boolean isForbidNonModeledInboxMessages() { - return forbidNonModeledInboxMessages; + public boolean isEnforceOutboxMessages() { + return enforceOutboxMessages; } @Override - public boolean isEnforceOutboxMessages() { - return enforceOutboxMessages; + public boolean isForbidThingDescriptionDeletion() { + return forbidThingDescriptionDeletion; + } + + @Override + public boolean isForbidNonModeledAttributes() { + return forbidNonModeledAttributes; + } + + @Override + public boolean isForbidNonModeledInboxMessages() { + return forbidNonModeledInboxMessages; } @Override @@ -144,13 +144,13 @@ public int hashCode() { public String toString() { return getClass().getSimpleName() + " [" + "enforceThingDescriptionModification=" + enforceThingDescriptionModification + - ", forbidThingDescriptionDeletion=" + forbidThingDescriptionDeletion + ", enforceAttributes=" + enforceAttributes + - ", forbidNonModeledAttributes=" + forbidNonModeledAttributes + ", enforceInboxMessagesInput=" + enforceInboxMessagesInput + ", enforceInboxMessagesOutput=" + enforceInboxMessagesOutput + - ", forbidNonModeledInboxMessages=" + forbidNonModeledInboxMessages + ", enforceOutboxMessages=" + enforceOutboxMessages + + ", forbidThingDescriptionDeletion=" + forbidThingDescriptionDeletion + + ", forbidNonModeledAttributes=" + forbidNonModeledAttributes + + ", forbidNonModeledInboxMessages=" + forbidNonModeledInboxMessages + ", forbidNonModeledOutboxMessages=" + forbidNonModeledOutboxMessages + "]"; } diff --git a/wot/api/src/main/java/org/eclipse/ditto/wot/api/validator/DefaultWotThingModelValidator.java b/wot/api/src/main/java/org/eclipse/ditto/wot/api/validator/DefaultWotThingModelValidator.java index 190b9aa2de..af0f86ce0b 100644 --- a/wot/api/src/main/java/org/eclipse/ditto/wot/api/validator/DefaultWotThingModelValidator.java +++ b/wot/api/src/main/java/org/eclipse/ditto/wot/api/validator/DefaultWotThingModelValidator.java @@ -346,6 +346,9 @@ public CompletionStage validateFeatureDefinitionModification(final Feature ) { final ValidationContext context = buildValidationContext(dittoHeaders, featureDefinition); return provideValidationConfigIfWotValidationEnabled(context) + .filter(validationConfig -> validationConfig.isEnabled() && + validationConfig.getFeatureValidationConfig().isEnforceFeatureDescriptionModification() + ) .map(validationConfig -> fetchResolveAndValidateWith(featureDefinition.getFirstIdentifier(), dittoHeaders, featureThingModel -> diff --git a/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/FeatureValidationConfig.java b/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/FeatureValidationConfig.java index 4bd6d94198..353bb14e9b 100644 --- a/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/FeatureValidationConfig.java +++ b/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/FeatureValidationConfig.java @@ -29,11 +29,6 @@ public interface FeatureValidationConfig { */ boolean isEnforceFeatureDescriptionModification(); - /** - * @return whether to forbid deletion of a Feature's {@code description}. - */ - boolean isForbidFeatureDescriptionDeletion(); - /** * @return whether to enforce that all modeled features (submodels referenced in the Thing's {@code definition}'s * WoT model) are present. @@ -41,56 +36,60 @@ public interface FeatureValidationConfig { boolean isEnforcePresenceOfModeledFeatures(); /** - * @return whether to forbid adding features to a Thing which were not defined in its {@code definition}'s - * WoT model. + * @return whether to enforce/validate properties of a feature following the defined WoT properties. */ - boolean isForbidNonModeledFeatures(); + boolean isEnforceProperties(); /** - * @return whether to enforce/validate properties of a feature following the defined WoT properties. + * @return whether to enforce/validate desired properties of a feature following the defined WoT properties. */ - boolean isEnforceProperties(); + boolean isEnforceDesiredProperties(); /** - * @return whether to forbid persisting properties which are not defined as properties in the WoT model. + * @return whether to enforce/validate inbox messages to a feature following the defined WoT action "input". */ - boolean isForbidNonModeledProperties(); + boolean isEnforceInboxMessagesInput(); /** - * @return whether to enforce/validate desired properties of a feature following the defined WoT properties. + * @return whether to enforce/validate inbox message responses to a feature following the defined WoT action "output". */ - boolean isEnforceDesiredProperties(); + boolean isEnforceInboxMessagesOutput(); /** - * @return whether to forbid persisting desired properties which are not defined as properties in the WoT model. + * @return whether to enforce/validate outbox messages from a feature following the defined WoT events. */ - boolean isForbidNonModeledDesiredProperties(); + boolean isEnforceOutboxMessages(); /** - * @return whether to enforce/validate inbox messages to a feature following the defined WoT action "input". + * @return whether to forbid deletion of a feature's {@code description}. */ - boolean isEnforceInboxMessagesInput(); + boolean isForbidFeatureDescriptionDeletion(); /** - * @return whether to enforce/validate inbox message responses to a feature following the defined WoT action "output". + * @return whether to forbid adding features to a Thing which were not defined in its {@code definition}'s + * WoT model. */ - boolean isEnforceInboxMessagesOutput(); + boolean isForbidNonModeledFeatures(); /** - * @return whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model. + * @return whether to forbid persisting properties which are not defined as properties in the WoT model. */ - boolean isForbidNonModeledInboxMessages(); + boolean isForbidNonModeledProperties(); /** - * @return whether to enforce/validate outbox messages from a feature following the defined WoT actions. + * @return whether to forbid persisting desired properties which are not defined as properties in the WoT model. */ - boolean isEnforceOutboxMessages(); + boolean isForbidNonModeledDesiredProperties(); /** - * @return whether to forbid dispatching of outbox messages which are not defined as actions in the WoT model. + * @return whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model. */ - boolean isForbidNonModeledOutboxMessages(); + boolean isForbidNonModeledInboxMessages(); + /** + * @return whether to forbid dispatching of outbox messages which are not defined as events in the WoT model. + */ + boolean isForbidNonModeledOutboxMessages(); /** * An enumeration of the known config path expressions and their associated default values for @@ -98,32 +97,31 @@ public interface FeatureValidationConfig { */ enum ConfigValue implements KnownConfigValue { - ENFORCE_FEATURE_DESCRIPTION_MODIFICATION("enforce-feature-description-modification", true), - - FORBID_FEATURE_DESCRIPTION_DELETION("forbid-feature-description-deletion", true), + ENFORCE_FEATURE_DESCRIPTION_MODIFICATION("enforce.feature-description-modification", true), - ENFORCE_PRESENCE_OF_MODELED_FEATURES("enforce-presence-of-modeled-features", true), + ENFORCE_PRESENCE_OF_MODELED_FEATURES("enforce.presence-of-modeled-features", true), - FORBID_NON_MODELED_FEATURES("forbid-non-modeled-features", true), + ENFORCE_PROPERTIES("enforce.properties", true), - ENFORCE_PROPERTIES("enforce-properties", true), + ENFORCE_DESIRED_PROPERTIES("enforce.desired-properties", true), - FORBID_NON_MODELED_PROPERTIES("forbid-non-modeled-properties", false), + ENFORCE_INBOX_MESSAGES_INPUT("enforce.inbox-messages-input", true), - ENFORCE_DESIRED_PROPERTIES("enforce-desired-properties", true), + ENFORCE_INBOX_MESSAGES_OUTPUT("enforce.inbox-messages-output", true), - FORBID_NON_MODELED_DESIRED_PROPERTIES("forbid-non-modeled-desired-properties", true), + ENFORCE_OUTBOX_MESSAGES("enforce.outbox-messages", true), - ENFORCE_INBOX_MESSAGES_INPUT("enforce-inbox-messages-input", true), + FORBID_FEATURE_DESCRIPTION_DELETION("forbid.feature-description-deletion", true), - ENFORCE_INBOX_MESSAGES_OUTPUT("enforce-inbox-messages-output", true), + FORBID_NON_MODELED_FEATURES("forbid.non-modeled-features", true), - FORBID_NON_MODELED_INBOX_MESSAGES("forbid-non-modeled-inbox-messages", true), + FORBID_NON_MODELED_PROPERTIES("forbid.non-modeled-properties", true), - ENFORCE_OUTBOX_MESSAGES("enforce-outbox-messages", true), + FORBID_NON_MODELED_DESIRED_PROPERTIES("forbid.non-modeled-desired-properties", true), - FORBID_NON_MODELED_OUTBOX_MESSAGES("forbid-non-modeled-outbox-messages", true); + FORBID_NON_MODELED_INBOX_MESSAGES("forbid.non-modeled-inbox-messages", true), + FORBID_NON_MODELED_OUTBOX_MESSAGES("forbid.non-modeled-outbox-messages", true); private final String path; private final Object defaultValue; diff --git a/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/ThingValidationConfig.java b/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/ThingValidationConfig.java index 7cb8ea067c..6eca05c69a 100644 --- a/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/ThingValidationConfig.java +++ b/wot/validation/src/main/java/org/eclipse/ditto/wot/validation/config/ThingValidationConfig.java @@ -29,21 +29,11 @@ public interface ThingValidationConfig { */ boolean isEnforceThingDescriptionModification(); - /** - * @return whether to forbid deletion of a Thing's {@code description}. - */ - boolean isForbidThingDescriptionDeletion(); - /** * @return whether to enforce/validate attributes of a thing following the defined WoT properties. */ boolean isEnforceAttributes(); - /** - * @return whether to forbid persisting attributes which are not defined as properties in the WoT model. - */ - boolean isForbidNonModeledAttributes(); - /** * @return whether to enforce/validate inbox messages to a thing following the defined WoT action "input". */ @@ -55,17 +45,27 @@ public interface ThingValidationConfig { boolean isEnforceInboxMessagesOutput(); /** - * @return whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model. + * @return whether to enforce/validate outbox messages from a thing following the defined WoT event "data". */ - boolean isForbidNonModeledInboxMessages(); + boolean isEnforceOutboxMessages(); /** - * @return whether to enforce/validate outbox messages from a thing following the defined WoT actions. + * @return whether to forbid deletion of a thing's {@code description}. */ - boolean isEnforceOutboxMessages(); + boolean isForbidThingDescriptionDeletion(); + + /** + * @return whether to forbid persisting attributes which are not defined as properties in the WoT model. + */ + boolean isForbidNonModeledAttributes(); + + /** + * @return whether to forbid dispatching of inbox messages which are not defined as actions in the WoT model. + */ + boolean isForbidNonModeledInboxMessages(); /** - * @return whether to forbid dispatching of outbox messages which are not defined as actions in the WoT model. + * @return whether to forbid dispatching of outbox messages which are not defined as events in the WoT model. */ boolean isForbidNonModeledOutboxMessages(); @@ -75,23 +75,23 @@ public interface ThingValidationConfig { */ enum ConfigValue implements KnownConfigValue { - ENFORCE_THING_DESCRIPTION_MODIFICATION("enforce-thing-description-modification", true), + ENFORCE_THING_DESCRIPTION_MODIFICATION("enforce.thing-description-modification", true), - FORBID_THING_DESCRIPTION_DELETION("forbid-thing-description-deletion", true), + ENFORCE_ATTRIBUTES("enforce.attributes", true), - ENFORCE_ATTRIBUTES("enforce-attributes", true), + ENFORCE_INBOX_MESSAGES_INPUT("enforce.inbox-messages-input", true), - FORBID_NON_MODELED_ATTRIBUTES("forbid-non-modeled-attributes", true), + ENFORCE_INBOX_MESSAGES_OUTPUT("enforce.inbox-messages-output", true), - ENFORCE_INBOX_MESSAGES_INPUT("enforce-inbox-messages-input", true), + ENFORCE_OUTBOX_MESSAGES("enforce.outbox-messages", true), - ENFORCE_INBOX_MESSAGES_OUTPUT("enforce-inbox-messages-output", true), + FORBID_THING_DESCRIPTION_DELETION("forbid.thing-description-deletion", true), - FORBID_NON_MODELED_INBOX_MESSAGES("forbid-non-modeled-inbox-messages", true), + FORBID_NON_MODELED_ATTRIBUTES("forbid.non-modeled-attributes", true), - ENFORCE_OUTBOX_MESSAGES("enforce-outbox-messages", true), + FORBID_NON_MODELED_INBOX_MESSAGES("forbid.non-modeled-inbox-messages", true), - FORBID_NON_MODELED_OUTBOX_MESSAGES("forbid-non-modeled-outbox-messages", true); + FORBID_NON_MODELED_OUTBOX_MESSAGES("forbid.non-modeled-outbox-messages", true); private final String path; diff --git a/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationFeatureLevelTest.java b/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationFeatureLevelTest.java index c9275709f7..1c42d44427 100644 --- a/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationFeatureLevelTest.java +++ b/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationFeatureLevelTest.java @@ -200,6 +200,7 @@ public void setUp() { when(validationConfig.isEnabled()).thenReturn(true); final FeatureValidationConfig featureValidationConfig = mock(FeatureValidationConfig.class); + when(featureValidationConfig.isEnforceFeatureDescriptionModification()).thenReturn(true); when(featureValidationConfig.isEnforcePresenceOfModeledFeatures()).thenReturn(true); when(featureValidationConfig.isForbidNonModeledFeatures()).thenReturn(true); when(featureValidationConfig.isEnforceProperties()).thenReturn(true); diff --git a/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationThingLevelTest.java b/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationThingLevelTest.java index b9ad26d1dc..e5c80929f2 100644 --- a/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationThingLevelTest.java +++ b/wot/validation/src/test/java/org/eclipse/ditto/wot/validation/WotThingModelValidationThingLevelTest.java @@ -173,6 +173,7 @@ public void setUp() { when(validationConfig.isEnabled()).thenReturn(true); final ThingValidationConfig thingValidationConfig = mock(ThingValidationConfig.class); + when(thingValidationConfig.isEnforceThingDescriptionModification()).thenReturn(true); when(thingValidationConfig.isEnforceAttributes()).thenReturn(true); when(thingValidationConfig.isForbidNonModeledAttributes()).thenReturn(true); when(thingValidationConfig.isEnforceInboxMessagesInput()).thenReturn(true);