-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to enforce validation based on referenced WoT model #1650
Comments
I think that we need to validate always what the target state of the complete thing (or feature if only a feature was modifier) would be against the model. So after enforcement (different permissions should not yield different validation results), but before applying a modify command to the persistence. We should also monitor how much time validation takes, by adding metrics (spans) to the existing signal processing trace. It would ne nice to have the validation as separate Java Module so that it could also be used as a library. |
Another idea on the enforcement: I am thinking especially about eg connections where we don't necessarily rely on a user input to validate. |
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
…hingModel Signed-off-by: Thomas Jäckle <[email protected]>
…desired properties validation * taking care of e.g. "ditto:category" defined * first validation error will provide the error output (which is for now simpler and results in quicker obtained validation errors) Signed-off-by: Thomas Jäckle <[email protected]>
* validating features and properties as part of "modify thing" * handling "ditto:category" correctly * ensuring completeness of defined features * validation on creation/modification * of thing * of attributes * on attribute * on features * on feature Signed-off-by: Thomas Jäckle <[email protected]>
…property Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
…hingModel Signed-off-by: Thomas Jäckle <[email protected]>
…desired properties validation * taking care of e.g. "ditto:category" defined * first validation error will provide the error output (which is for now simpler and results in quicker obtained validation errors) Signed-off-by: Thomas Jäckle <[email protected]>
* restructuring of "ditto-wot" module to enable re-usability of non-pekko/non-Ditto specifics * adding "validator" concept and first sample implementation (WIP) Signed-off-by: Thomas Jäckle <[email protected]>
…hingModel Signed-off-by: Thomas Jäckle <[email protected]>
…desired properties validation * taking care of e.g. "ditto:category" defined * first validation error will provide the error output (which is for now simpler and results in quicker obtained validation errors) Signed-off-by: Thomas Jäckle <[email protected]>
* validating features and properties as part of "modify thing" * handling "ditto:category" correctly * ensuring completeness of defined features * validation on creation/modification * of thing * of attributes * on attribute * on features * on feature Signed-off-by: Thomas Jäckle <[email protected]>
…property Signed-off-by: Thomas Jäckle <[email protected]>
* enforce modifying thing definition + feature definition * enhance configuration options
…the thing for validationError paths
…their responses * also updated some dependencies * simplified DefaultWotThingModelValidator a little
…iding "type" (valid for e.g. "oneOf") use * update json-schema-validator library
…ation in smaller pieces * strict split between config reading in DefaultWotThingModelValidation and static functionality in Internal* classes
* based on either DittoHeaders or on ThingDefinition/FeatureDefinition URLs
* fixed and harmonized other traces while doing that in order to get correct parent hierarchy of spans
…ased on the WoT model * restructured some too long methods * fixed remaining TODOs
* also for dynamic part * changed config structure a bit in order to better fit Helm YAML config
…e corner cases * e.g. deeply nested updates, removing definition via PATCH * enabled WoT based validation by default
* first choosing potentially new definition and only as fall-back the old one
Currently, Ditto's WoT Integration does not ensure/enforce the referenced model.
As the reference implementation, Eclipse Thingweb did also not do that we thought that would be a common practice to move validation to eg producers of messages.
In practice I now see that an enforcement of the model by Ditto would have great benefits and is the best place to add validation.
This would eg ensure that different API consumers always modify a thing only in the intended and modeled way.
That would be especially important if the Ditto managed twin is used in an Event driven system, where changes of the twin state is reacted to by eg issuing a command downlink to an actual device (using "desired properties" approach).
This issue should track:
I expect this to be quite difficult to do, as we have to extract the JsonSchema parts from WoT TM models and apply them.
Both when eg a complete thing is modified and also partially, when eg only a single feature or even property or even part of a property is modified.
The text was updated successfully, but these errors were encountered: