The TelemetryBlob type provides helper methods that can be used to validate that provided blobs are:
Valid JSON
JSON objects
Contain a top-level "version" field
Are not too big.
The validity of provided JSON blobs is checked when they are received via a Generate() interface.
Also update client side item handling to leverage the json.RawMessage type for storing the JSON blobs; this avoid undesirable processing of the provided JSON blob data, which should remain untouched en-route to long term storage in the SUSE Telemetry service.
Minor restructuring of the client side library, moving limits to it's own subpackage to avoid an import loop when adding the CheckLimits() helper method to the TelemetryBlob.
The TelemetryBlob type provides helper methods that can be used to validate that provided blobs are:
The validity of provided JSON blobs is checked when they are received via a Generate() interface.
Also update client side item handling to leverage the json.RawMessage type for storing the JSON blobs; this avoid undesirable processing of the provided JSON blob data, which should remain untouched en-route to long term storage in the SUSE Telemetry service.
Minor restructuring of the client side library, moving limits to it's own subpackage to avoid an import loop when adding the CheckLimits() helper method to the TelemetryBlob.
Fixes: #41, #26