Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SDK: Enforce telemetry data JSON blob requirements #41

Closed
rtamalin opened this issue Aug 1, 2024 · 0 comments · Fixed by #42
Closed

SDK: Enforce telemetry data JSON blob requirements #41

rtamalin opened this issue Aug 1, 2024 · 0 comments · Fixed by #42
Assignees
Labels

Comments

@rtamalin
Copy link
Collaborator

rtamalin commented Aug 1, 2024

A submitted telemetry data JSON blob must satisfy the following requirements:

  • it must be valid JSON
  • it must represent a JSON object, i.e. start with { and end with }
  • it must include a version field in the top-level object; no specific type is mandated, just that it must exist.
@rtamalin rtamalin added the SDK label Aug 1, 2024
@rtamalin rtamalin self-assigned this Aug 1, 2024
rtamalin added a commit that referenced this issue Aug 2, 2024
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.

Fixes: #41, #26
rtamalin added a commit that referenced this issue Aug 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant