Closed ts5746 closed 4 years ago
Implemented in existing module lib/protocol/codec.js
without additional steps in the TX and RX processing chains. The JSON message schema has been extended to support this feature. Tested and merged into develop in a7c22f2168408941613a9f82820071aa04a34e23.
Description
Check incoming and outgoing Whiteflag messages for the correct (combination of) subject code and object type i.a.w. the Whiteflag specification.
Rationale
Currently, Whiteflag messages are checked against the JSON message schema in
./lib/protocol/static/message.schema.json
. However, this check does not include whether the (combination of) values used in theSubjectCode
andObjectType
fields are valid in accordance with the Whiteflag specification. The JSON message schema itself already includes all valid values.Solution
Specification
Incoming (tx) and outgoing (rx) messages should be checked for correct values just after the messages are checked against the schema of the Whiteflag specification, which does not check the (combination of) values for subject and object codes. Possibly, this check might be disabled, separately for tx and rx, in the
whiteflag.toml
configuration file for performance reasons.Affected components
./lib/protocol
, sincecodec.js
does the full schema check andreference.js
the reference check.Alternatives
Alternatively, the check is not implemented and has to be dealt with at application level, meaning that the API does not guarantee protocol compliance on this aspect.