Repository navigation
Fixes from HACS - Mask secrets in logs, redact card names in diagnostics - #141
Merged
Merged
Conversation
async_PropertyDebug logged every watched property with its value, so the cloud API key (cak) and the OCPP keys appeared in the Home Assistant log. An exclude list alone is not enough because properties listed explicitly via set_debug_properties bypass it. utils.py: - Replace the value of cak, ocppck, ocppcc and ocppsc by *** before logging, in both the all-properties and the explicit-list mode. The property name is still logged so that changes remain visible. tests/test_utils.py: - Add tests for the masked secrets and for unchanged logging of other properties.
__on_message logged every received message at debug level, including the values of the cloud API key (cak) and the OCPP keys (ocppck, ocppcc, ocppsc). wattpilot library (0.2.2g -> 0.2.2h, __init__.py and PKG-INFO): - Add CONST_SECRET_PROPERTIES and _mask_secrets() which replace the value of these properties inside the message by ***, including values with escaped quotes. - __on_message masks the message before logging and only builds the log text if debug logging is enabled. The stored property values are not changed. tests/test_wattpilot_lib.py: - Add tests for the masked log output, all secret properties, escaped quotes and unchanged stored values.
The cards property contains a name for each configured RFID card, which is personal data and was part of the downloadable diagnostics. diagnostics.py: - Add cards to REDACT_ALLPROPS. tests_ha/test_diagnostics.py: - Add a test on a real Home Assistant core which checks that the cloud API key and the card names are redacted and other properties are kept. .github/workflows/ci.yml: - Install importlib_metadata in the ha-flow-tests job because the diagnostics module imports it.
mstoffel-sag
added a commit
to mstoffel-sag/wattpilot-HA
that referenced
this pull request
Oct 22, 2026
Brings in upstream PRs mk-maddin#138-mk-maddin#141: shutdown/setup error-path fixes, connection config in the retry state (mk-maddin#115), failed responses without requestId (mk-maddin#133), empty car profile (mk-maddin#134), secret masking in debug logs and diagnostics (wattpilot 0.2.2h), and the AGENTS.md agent guidance. Keeps the fork's manifest version (0.4.9) over upstream's 0.4.0, the Wattpilot.astValues fix and the dropped standalone vendor files. .gitignore now ignores CLAUDE.local.md instead of CLAUDE.md, since upstream tracks its own CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HLdU8AYNGCyfJSLQ8HUwmb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the code review feedback from the HACS default repository submission (hacs/default#11260).
async_PropertyDebugnow logs***instead of the value forcak,ocppck,ocppccandocppsc, also for properties that are watched explicitly viaset_debug_properties.cards(contains RFID card names) is added toREDACT_ALLPROPS.tests_ha/);importlib_metadataadded to theha-flow-testsjob.The other review points (awaited cleanup coroutines,
chargerdefined before use, disconnect on failed connect) were already fixed onmaster.No change to entities, services or configuration. The log and diagnostics output is the only visible difference.