Skip to content

fix: redact private data in device diagnostics - #1026

Open
infy1995 wants to merge 1 commit into
Python-roborock:mainfrom
infy1995:fix/a01-diagnostics-redaction
Open

infy1995 wants to merge 1 commit into
Python-roborock:mainfrom
infy1995:fix/a01-diagnostics-redaction

Conversation

@infy1995

Copy link
Copy Markdown
Contributor

Summary

A01 devices report some data points as JSON stored in a string. redact_device_data only checked dictionary keys, so DP 10005 (product info) went into diagnostics unredacted, with the serial number, Wi-Fi name, IP and MAC. Home Assistant diagnostics build this section from device.diagnostic_data(), so the values ended up in downloaded diagnostics files.

Changes

  • redact_device_data now also redacts JSON documents stored as strings. A string that looks like JSON but cannot be parsed is fully redacted. A string with nothing to redact is returned unchanged.
  • ssid and iotName are now redacted. iotName holds the same user-given room name as the already redacted rawName.
  • SND_STATE (10004) and PRODUCT_INFO (10005) now decode. The device sends them as JSON strings, but the converters passed the string to from_dict, so they always returned None.
  • A01 devices (Dyad and Zeo) now include their decoded state as traits in diagnostic_data(), as V1 and Q10 devices do.

Testing

  • Added tests for the redaction, the decoding and the A01 diagnostics.
  • Generated diagnostics for an account with an F25 Ultra (a194) and a Saros 10R (a144). None of the identifiers remained in the output.

This does not depend on #1021 and merges cleanly with it in either order.

Redact JSON documents stored as strings, such as the A01 product info
data point, which exposed the serial number, Wi-Fi name, IP and MAC.
Also redact ssid and iotName.

Decode the A01 product info and voice pack data points, which the device
reports as JSON strings and always decoded to None, and add the decoded
A01 state to device diagnostics as traits.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant