3.8 Integrity Validation
3.8 Integrity Validation
Hashing, signatures, and integrity assurance are container-level responsibilities and are specified in Chapter 7. The RUML JSON file contains no hash or signature of itself; for the hashes of other content it may contain, see 3.2.4.
Structural validation on load:
Implementations MUST check the structural validity when loading a RUML file:
- JSON validity: The file MUST be valid JSON (
Rule FMT-02FMT-02 The file MUST be valid JSON (RFC 8259), and its root MUST be an object.) - Required fields: All required fields defined in Chapter 3.3 MUST be
present (
Rule META-01META-01metadataMUST haveid,version,created,modifiedandstatus.) - Type conformity: Field values MUST conform to the data types defined in
Chapter 3.2 (
Rule FMT-13FMT-13 Every field value MUST have the data type 3.2.3 gives it: aNumbera JSON number, aBooleana JSON Boolean, aDateTimean RFC 3339date-time, anEnumone of the values defined for the field, anObjecta JSON object, anArraya JSON array.) - Node references: All
childrenreferences MUST point to existing LexIDs in thenodesobject (Rule NODE-10NODE-10 Every entry ofchildrenMUST be a key ofrulemap.nodes.) - UUID uniqueness: The
idof every node andmetadata.idMUST be unique within the file (Rule NODE-08NODE-08 Theidof a node MUST NOT equal theidof another node ormetadata.id.). A UUID that refers to another node or file, such asreplacedByor a tree reference, repeats that id
Validation on changes:
On every change to a RUML file, the following MUST be done:
- The
modifiedfield must be updated - Structural validity must be re-verified
Hash verification and signature checking are performed at container level. Details see Chapter 7.