Elektra  0.8.23
Validation

Problem

Validation plugins operate as independent blackboxes. For every backend each mounted validation plugin iterates over the whole keyset, checks every key for its trigger metakey, and validates the key.

Currently all needed validation plugins need to be specified at mount-time - if additional validation is required, the backend has to be remounted with the required plugins and plugin configuration.

If validation of a key fails, each plugin decides on its own how to handle the issue and proceed in ways that might be different than what is expected or desired.

Constraints

Assumptions

While plugins should always fail and return an error if validation fails on kdbSet, there are be can be several different requirements for what should happen on kdbGet and handle problems e.g.

Considered Alternatives

Decision

Use a wrapper plugin to iterate over the keyset and delegate the validation of each key to the corresponding validation plugin.

Rationale

Implications

validation plugins have to export their validation routine

static int validateKey(const Key * key, const Key * errorKey)

returning 1 if validation succeeded, 0 on failure

Related decisions

Notes